The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
hi
i am trying to set the source of a combobox cell of grid control
gridControl1[rowIndex, colIndex + 2].ChoiceList = items;
i have a string array which needs to be converted to Collections.Specialized.StringCollection
can someone help me with this conversion
or is there a way so that i can directly
set the source of the combobox cell in gridcontrol
thanks
Shri
ADAdministrator 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.