We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

set the source of a combobox which is in a cell of datagrid

Thread ID:





18629 Sep 3,2004 08:04 PM UTC Sep 3,2004 10:43 PM UTC WinForms 1
Tags: GridControl
Asked On September 3, 2004 08:04 PM UTC

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

Administrator [Syncfusion]
Replied On 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.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon