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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

combobox

Thread ID:

Created:

Updated:

Platform:

Replies:

68620 Sep 26,2007 01:42 AM UTC Sep 26,2007 11:52 AM UTC Windows Forms 4
loading
Tags: GridControl
John
Asked On September 26, 2007 01:42 AM UTC

Hi,

I tried using this code, but it doesn't work.


this.gridDataboundGrid.Binder.InternalColumns[1].StyleInfo.CellType = "ComboBox";
this.gridDataboundGrid.Binder.InternalColumns[1].StyleInfo.CellValueType = typeof(string);
this.gridDataboundGrid.Binder.InternalColumns[1].StyleInfo.DropDownStyle = Syncfusion.Windows.Forms.Grid.GridDropDownStyle.Exclusive;


Please help. Thanks!

Jeba S [Syncfusion]
Replied On September 26, 2007 03:57 AM UTC

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.htm

Kindly let us know if you need any further assitance.

Thank you for using Syncfusion Products.

Best Regards,
Jeba.

John
Replied On September 26, 2007 07:40 AM UTC

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.htm

Kindly let us know if you need any further assitance.

Thank you for using Syncfusion Products.

Best Regards,
Jeba.

John
Replied On September 26, 2007 07:45 AM UTC

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.htm

Kindly let us know if you need any further assitance.

Thank you for using Syncfusion Products.

Best Regards,
Jeba.

Jeba S [Syncfusion]
Replied On September 26, 2007 11:52 AM UTC

Hi coder12345,

1.Do I need to do it before I do bind to the datagrid or after?
>>>>>>>>>>>>
You should use the code after binding the datagrid.

2.And also, is the DisplayMember and the Valuemember just the mappingname of the column?
>>>>>>>>>>>>

DisplayMember:Sets a string that specifies the mappingname of the column from which to retrieve strings for display in the combo box.

ValueMember:Sets a string that specifies the mappingname of the column from which to get values that correspond to the selections in the drop down list


3.ComboBox with DataView:
>>>>>>>>>>>>>>>>>>>>>>
I am afraid that I was not able to reproduce the dataview issue. I have created a sample to test this issue and it is available in the following link.
http://websamples.syncfusion.com/samples/Grid.Windows/F68620_Modified/main.htm


DataView dv = new DataView();
dv = dt.DefaultView;

this.gridDataBoundGrid1.Binder.InternalColumns[0].StyleInfo.CellType = "ComboBox";
this.gridDataBoundGrid1.Binder.InternalColumns[0].StyleInfo.DataSource = dv;


Please have a look at the above sample and if still the issue exists, could you please elaborate the reproduce steps or modify the above sample to show the issue so that we could sort out the cause of the issue and provide you a solution?

Regards,
Jeba.

CONFIRMATION

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.

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

;