Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
35
Ultragrid column not displaying as drop down
posted

I have 2 grids on two separate forms. Both are bound to the same type. I have a helper method that configures a column to be a drop down.

It works in one grid and not the other.

The column in the grid where it is not working is clearly binding to the data in the data source because the values are correct. It is just not showing as a drop down.

If I add an unbound column to the grid and configure it as a drop down the code works (see below):

const string TEST_VALUE = "DropdownTest";
ValueList vl = null;
if(!Grid.DisplayLayout.ValueLists.Exists(TEST_VALUE))
{
	vl = Grid.DisplayLayout.ValueLists.Add(TEST_VALUE);
	vl.ValueListItems.Add("Red");
	vl.ValueListItems.Add("Green");
	vl.ValueListItems.Add("Blue");
}

if(!columns.Exists(TEST_VALUE))
{
	UltraGridColumn dropdown = columns.Add(TEST_VALUE);
	dropdown.ValueList = vl;
	dropdown.CellActivation = Activation.AllowEdit;
	dropdown.CellClickAction = CellClickAction.Edit;
	dropdown.Style = ColumnStyle.DropDownList;
	dropdown.Header.Caption = "Lol whut?";
}

What could possibly be interfering with displaying the drop down for this column? I feel like I have checked everything...