Hi,
I figured out what the problem might be...when I set the datasource to a datatable, it works. But, when I try to set the datasource to a dataview, it doesn't work. Is there a way to get it the combobox to take the items from a dataview? Thanks!
>Hi,
I tried the code, but it still doesn't work. Do I need to do it before I do bind to the datagrid or after?
And also, is the DisplayMember and the Valuemember just the mappingname of the column? Thanks!
>Hi coder12345,
Thank you for posting query to us.
You can assign values to the ComboBox using the DataSource. Please refer this code snippets:
this.gridDataBoundGrid1.Binder.InternalColumns[0].StyleInfo.CellType = "ComboBox";
this.gridDataBoundGrid1.Binder.InternalColumns[0].StyleInfo.DataSource = dt;
this.gridDataBoundGrid1.Binder.InternalColumns[0].StyleInfo.DisplayMember = "Col0";
this.gridDataBoundGrid1.Binder.InternalColumns[0].StyleInfo.ValueMember = "Col0";
this.gridDataBoundGrid1.Binder.InternalColumns[0].StyleInfo.CellValueType = typeof(string);
this.gridDataBoundGrid1.Binder.InternalColumns[0].StyleInfo.DropDownStyle = Syncfusion.Windows.Forms.Grid.GridDropDownStyle.Exclusive;
Please refer the below sample which shows a combo box with Exclusive DropDown.
http://websamples.syncfusion.com/samples/Grid.Windows/F68620/main.htmKindly let us know if you need any further assitance.
Thank you for using Syncfusion Products.
Best Regards,
Jeba.