Click here to Skip to main content
12,631,123 members (31,428 online)
Rate this:
 
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 20:42pm
v2
Comments
Richard MacCutchan 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)

  Print Answers RSS
Top Experts
Last 24hrsThis month


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

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100