Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#
I have question about timezone, i want to fill the dropdown with all timezone in world and when i select one of them i want to save the selected value of that dropdown, for that i use the code
ReadOnlyCollection<TimeZoneInfo> timezoneInfo;
timezoneInfo = TimeZoneInfo.GetSystemTimeZones();
strTimezone = string.Join(";", from Time in timezoneInfo
select string.Format("{0}:{1}",
Time.Id, Time.DisplayName));
but with the help of that my dropdown is fill with only one timezone which is chennai kolkatta because my system has only one timezone which is chennai kolkatta that dropdown contain only one value, but i want all timezone for that what i do please help me as early as possible.
Posted 7-Dec-12 19:42pm
v2
Comments
Richard MacCutchan at 8-Dec-12 5:17am
   
You need to enumerate your collection to see all the timezones.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Set the datasource of your dropdown to the collection ...
this.comboBox1.DataSource = timezoneInfo;
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web02 | 2.8.140709.1 | Last Updated 8 Dec 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid