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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Combo Box in GridGroupingControl

Thread ID:

Created:

Updated:

Platform:

Replies:

61390 May 24,2007 02:57 PM UTC May 24,2007 03:33 PM UTC WinForms 2
loading
Tags: GridControl
Dan Dorey
Asked On May 24, 2007 02:57 PM UTC

Hi, I'm using v5.

I'm looking at your CustomFieldType_2005 sample code. I want to add a column to a gridgroupingcontrol in the same manner.

I've tried adding the code below, but I'm unsure of how to create a list of items to select from. I know it's possible to do this with a dataset and datatables but I'd prefer not to go through that trouble if it's easier like the other controls in this example.

Thanks,
Dan

table.Columns.Add("List", typeof(string));
...
gridGroupingControl1.TableDescriptor.Columns.Add("List");
...
this.gridGroupingControl1.TableDescriptor.Columns["List"].Appearance.AnyRecordFieldCell.CellType = "ComboBox";

haneefm [Syncfusion]
Replied On May 24, 2007 03:09 PM UTC

Hi Dan,

You can set the style.DataSource to be the table for the entire combobox column, style.DisplayMember to be the name of the column in the table that you want to see displayed in the grid, and set style.ValueMember to be the name of the column in the table that has values that match the values originally displayed in the grid column. You also need to make it as a combobox cell. Please try the code snippet below and let me know if this helps.

this.gridGroupingControl1.TableDescriptor.Columns["List"].Appearance.AnyRecordFieldCell.CellType = "ComboBox";
this.gridGroupingControl1.TableDescriptor.Columns["List"].Appearance.AnyRecordFieldCell.DataSource = newDatatable;
this.gridGroupingControl1.TableDescriptor.Columns["List"].Appearance.AnyRecordFieldCell.ValueMember = "ColumnNameDoYouWantToseeInGrid";
this.gridGroupingControl1.TableDescriptor.Columns["List"].Appearance.AnyRecordFieldCell.DisplayMember = "ColumnNameDoYouWantTostoreInGrid";

Best regards,
Haneef

Dan Dorey
Replied On May 24, 2007 03:33 PM UTC

Perfect! Thanks for the quick response.

Dan

>Hi Dan,

You can set the style.DataSource to be the table for the entire combobox column, style.DisplayMember to be the name of the column in the table that you want to see displayed in the grid, and set style.ValueMember to be the name of the column in the table that has values that match the values originally displayed in the grid column. You also need to make it as a combobox cell. Please try the code snippet below and let me know if this helps.

this.gridGroupingControl1.TableDescriptor.Columns["List"].Appearance.AnyRecordFieldCell.CellType = "ComboBox";
this.gridGroupingControl1.TableDescriptor.Columns["List"].Appearance.AnyRecordFieldCell.DataSource = newDatatable;
this.gridGroupingControl1.TableDescriptor.Columns["List"].Appearance.AnyRecordFieldCell.ValueMember = "ColumnNameDoYouWantToseeInGrid";
this.gridGroupingControl1.TableDescriptor.Columns["List"].Appearance.AnyRecordFieldCell.DisplayMember = "ColumnNameDoYouWantTostoreInGrid";

Best regards,
Haneef

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

;