var list = new List<MyComboBoxItem>(); |
list.Add(new MyComboBoxItem { Description = "Description 1", IsGroupHeader = true, Text = "Header 1", Value = "myId1" }); |
list.Add(new MyComboBoxItem { Description = "Description 2", IsGroupHeader = false, Text = "Item 1", Value = "myId2" }); |
list.Add(new MyComboBoxItem { Description = "Description 3", IsGroupHeader = false, Text = "Item 2", Value = "myId3" }); |
list.Add(new MyComboBoxItem { Description = "Description 4", IsGroupHeader = false, Text = "Item 3", Value = "myId4" }); |
list.Add(new MyComboBoxItem { Description = "Description 5", IsGroupHeader = false, Text = "Item 4", Value = "myId5" }); |
list.Add(new MyComboBoxItem { Description = "Description 6", IsGroupHeader = false, Text = "Item 5", Value = "myId6" }); |
list.Add(new MyComboBoxItem { Description = "Description 7", IsGroupHeader = false, Text = "Item 6", Value = "myId7" }); |
|
list.Add(new MyComboBoxItem { Description = "Description 2", IsGroupHeader = true, Text = "Header 2", Value = "myId2" }); |
list.Add(new MyComboBoxItem { Description = "Description 12", IsGroupHeader = false, Text = "Item 11", Value = "myId11" }); |
list.Add(new MyComboBoxItem { Description = "Description 13", IsGroupHeader = false, Text = "Item 12", Value = "myId12" }); |
list.Add(new MyComboBoxItem { Description = "Description 14", IsGroupHeader = false, Text = "Item 13", Value = "myId13" }); |
list.Add(new MyComboBoxItem { Description = "Description 15", IsGroupHeader = false, Text = "Item 14", Value = "myId14" }); |
list.Add(new MyComboBoxItem { Description = "Description 16", IsGroupHeader = false, Text = "Item 15", Value = "myId15" }); |
list.Add(new MyComboBoxItem { Description = "Description 17", IsGroupHeader = false, Text = "Item 16", Value = "myId16" }); |
|
|
list.Add(new MyComboBoxItem { Description = "Description 3", IsGroupHeader = true, Text = "Header 3", Value = "myId3" }); |
list.Add(new MyComboBoxItem { Description = "Description 22", IsGroupHeader = false, Text = "Item 21", Value = "myId21" }); |
list.Add(new MyComboBoxItem { Description = "Description 23", IsGroupHeader = false, Text = "Item 22", Value = "myId22" }); |
list.Add(new MyComboBoxItem { Description = "Description 24", IsGroupHeader = false, Text = "Item 23", Value = "myId23" }); |
list.Add(new MyComboBoxItem { Description = "Description 25", IsGroupHeader = false, Text = "Item 24", Value = "myId24" }); |
list.Add(new MyComboBoxItem { Description = "Description 26", IsGroupHeader = false, Text = "Item 25", Value = "myId25" }); |
list.Add(new MyComboBoxItem { Description = "Description 27", IsGroupHeader = false, Text = "Item 26", Value = "myId26" }); |
|
|
myComboBox.DataSource = list; |
myComboBox.DataBind(); |