AD
Administrator
Syncfusion Team
September 3, 2004 10:43 PM UTC
You mentioned datagrid in your subject, but the code you show is for a GridControl. You cannot set cell properties (other than CellValue or Text) on individual cells in a GridDataBoundGrid. Normally, in a GridDataBoundGrid you set the style properties on the whole column as described in this KB. http://www.syncfusion.com/Support/article.aspx?id=562
If you want a single cell to have a special property set, then you would either have to handle grid.Model.QueryCellInfo or grid.PrepareViewStyleInfo and set the property dynamically in one of those events as described in this KB. http://www.syncfusion.com/Support/article.aspx?id=562
To add a string[] myArrayOfStrings to a StringCollection sc, you would used code like:
sc.AddRange(myStrings); //myStrings is declared as string[] myStrings;
If you look at the grid\samples\cellttypes\comboboxes sample that we ship, you can see code that sets up a ChoiceLisr for use in a combobox cell. This sample uses a GridControl, but the same type of style setting should work for a GridBoundColumn.StyleInfo in a GridDataBoundGrid.