UltraWebGrid: How to use a drop-down list in a column

Posted by Crossbrowser on Stack Overflow See other posts from Stack Overflow or by Crossbrowser
Published on 2008-08-18T21:03:18Z Indexed on 2010/04/21 9:13 UTC
Read the original article Hit count: 621

Filed under:
|
|
|
|

I'm using the Infragistics grid and I'm having a difficult time using a drop-down list as the value selector for one of my columns.

I tried reading the documentation but Infragistics' documentation is not so good. I've also taken a look at this discussion with no luck.

What I'm doing so far:

col.Type = ColumnType.DropDownList;
col.DataType = "System.String";

col.ValueList = myValueList;

where myValueList is:

ValueList myValueList = new ValueList();

myValueList.Prompt = "My text prompt";
myValueList.DisplayStyle = ValueListDisplayStyle.DisplayText;

foreach(MyObjectType item in MyObjectTypeCollection)
{
    myValueList.ValueItems.Add(item.ID, item.Text); // Note that the ID is a string (not my design)
}

When I look at the page, I expect to see a drop-down list in the cells for this column, but my columns are empty.

© Stack Overflow or respective owner

Related posts about c#

Related posts about ASP.NET