Hello everyone,
Right now I need to add a GridDropDownColumn at runtime, not design time, and the dropdowmitem's data come from a Dictionary, the key is the item's value, the value is the item's text. How can I do it?
Part of my code looks like :
But I got nothing, when I switch to the edit model, the dropdownlist has no items. Any one know how to do this?
Thanks and Best regards,
Bryan.
Right now I need to add a GridDropDownColumn at runtime, not design time, and the dropdowmitem's data come from a Dictionary, the key is the item's value, the value is the item's text. How can I do it?
Part of my code looks like :
Dictionary<string, string> dicValues = DropdownListData as Dictionary<string, string>; | |
if (dicValues != null) | |
{ | |
GridDropDownListColumnEditor editor = gridColumn.ColumnEditor as GridDropDownListColumnEditor; | |
foreach (KeyValuePair<string, string> value in dicValues) | |
{ | |
editor.DropDownListControl.Items.Add(new ListItem(value.Value, value.Key)); | |
} | |
} |
But I got nothing, when I switch to the edit model, the dropdownlist has no items. Any one know how to do this?
Thanks and Best regards,
Bryan.