I am using a GridDropDownColumn to show values from my tri-state boolean, and in edit-mode, this works. But I can't get it to show any value when not in edit-mode. Does anyone have any example on how to do this?
I am using OnItemDataBound to bind the value dynamically, like this:
How do I get hand on the GridDropDownListColumn when not in edit-mode?
I am using OnItemDataBound to bind the value dynamically, like this:
if (e.Item is GridEditableItem && e.Item.IsInEditMode) { GridEditableItem editedItem = e.Item as GridEditableItem; GridDropDownListColumnEditor editList = editedItem.EditManager.GetColumnEditor("DropDownColumnId") as GridDropDownListColumnEditor; if (editList != null) { editList.DataSource = GetDropDownListDataSource("DropDownColumnId"); editList.DataBind();string selectedValue = "";if (((Template)e.Item.DataItem).EnableCalculation.HasValue) { if ((bool)((Template)e.Item.DataItem).EnableCalculation) selectedValue = "1"; else selectedValue = "0"; } editList.DropDownListControl.SelectedValue = selectedValue; } }
How do I get hand on the GridDropDownListColumn when not in edit-mode?