I am trying to use a ComboBox in a databound grid.
Here is the criteria:
1. grid must be bound to a datatable.
2. drop down items come from a stringcollecion, or preferrably another datatable.
Here is my current test source.
// set the data source to the datatable
grdObjects.DataSource = dt;
grdObjects.BeginUpdate();
// create a sting collection
System.Collections.Specialized.StringCollection items = new System.Collections.Specialized.StringCollection();
items.Add("One");
items.Add("Two");
items.Add("Three");
items.Add("Four");
items.Add("Five");
items.Add("Six");
items.Add("Seven");
items.Add("Eight");
items.Add("Nine");
items.Add("Ten");
// setup the dropdown boxes in column 2
for (int i=0;i
RI
Richard
November 19, 2004 03:09 AM UTC
Sorry, I should have added, that the code runs through just fine, but the dropdowns do not display.
AD
Administrator
Syncfusion Team
November 19, 2004 05:09 AM UTC
In a GridDataBoundGrid, you set style properties for a column using the GridBoundColumn.StyleInfo property of that column. See this KB article.
http://www.syncfusion.com/Support/article.aspx?id=562
In a GridDataBoundGrid, the code you listed (using an indexer on individual cells to set style properties other than CellValue or Text) does not work. See this KB article.
http://www.syncfusion.com/Support/article.aspx?id=560