This is a migrated thread and some comments may be shown as answers.

GridDropDownColumn with tristate booleans

2 Answers 63 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Alexander
Top achievements
Rank 1
Alexander asked on 06 Mar 2012, 04:46 PM
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:
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?

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 07 Mar 2012, 06:23 AM
Hello,

Check the following forum thread which discuss the same.
Rad Grid Not Showing DropDownEditable Field value

Thanks,
Princy.
0
Alexander
Top achievements
Rank 1
answered on 07 Mar 2012, 09:56 AM
Thanks for your answer - that did it...
Tags
Grid
Asked by
Alexander
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Alexander
Top achievements
Rank 1
Share this question
or