ComboBoxCell MyDropDown() { var combo = new ComboBoxCell (); var items = new ListItemCollection (); items.Add (new ListItem{ Text = "Item 1" }); items.Add (new ListItem{ Text = "Item 2" }); items.Add (new ListItem{ Text = "Item 3" }); items.Add (new ListItem{ Text = "Item 4" }); combo.DataStore = items; return combo; }
public MyGridItem (Random rand, int row, ComboBoxCell dropDown) { // initialize to random values this.Row = row; var val = rand.Next (3); check = val == 0 ? (bool?)false : val == 1 ? (bool?)true : null; val = rand.Next (3); Image = val == 0 ? (Image)image1 : val == 1 ? (Image)image2 : null; text = string.Format ("Col 1 Row {0}", row); val = rand.Next (dropDown.DataStore.Count + 1); dropDownKey = val == 0 ? null : dropDown.DataStore [val - 1].Key; }
ComboBoxCell MyDropDown(string bindingProperty) { var combo = new ComboBoxCell(bindingProperty); combo.DataStore = new ListItemCollection { new ListItem { Text = "Item 1" }, new ListItem { Text = "Item 2" }, new ListItem { Text = "Item 3" }, new ListItem { Text = "Item 4" } }; return combo; }