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.

how to create gridcontrols cell model with 3 combo-boxes

Thread ID:

Created:

Updated:

Platform:

Replies:

91974 Dec 10,2009 04:13 PM Dec 11,2009 07:59 AM Windows Forms 1
loading
Tags: GridControl
Žygimantas
Asked On December 10, 2009 04:13 PM

Hello,i am using syncfusion gridcontrol. In each grid's cell there must be 3 combo-boxes "mounted" to datasets,how can i create custom cell model that would host 3 comboboxes? Could u please provide some examples? Thank u.
p.s. attached *.png example file



cell_model_with_3_cb_exmaple_d9a2fc9e.rar

Ranjeet Kumar [Syncfusion]
Replied On December 11, 2009 07:59 AM

Hi Žygimantas,

Thanks for your interest in Syncfusion Products.

In order to have three combobox in each Grid Control cell and each binded to different dataset, we may create a usercontrol that will host 3-Combobox and expose data binding properties for each to the main form that

hosts the grid control as shown below with the help of code snippets:

You may achieve the same by implementing custom cell feature and handle the Model and Renderer for the same.



\\ UserControlClass :

\\ This will expose the databinding properties to the main form

public void comboBox1SetValues(DataTable combo1Datasource, string combo1DisplayMember, string combo1ValueMember)
{
this.comboBoxAdv1.DataSource = combo1Datasource;
this.comboBoxAdv1.DisplayMember = combo1DisplayMember;
this.comboBoxAdv1.ValueMember = combo1ValueMember;

}
public void comboBox2SetValues(DataTable combo1Datasource, string combo1DisplayMember, string combo1ValueMember)
{
this.comboBoxAdv2.DataSource = combo1Datasource;
this.comboBoxAdv2.DisplayMember = combo1DisplayMember;
this.comboBoxAdv2.ValueMember = combo1ValueMember;

}
public void comboBox3SetValues(DataTable combo1Datasource, string combo1DisplayMember, string combo1ValueMember)
{
this.comboBoxAdv3.DataSource = combo1Datasource;
this.comboBoxAdv3.DisplayMember = combo1DisplayMember;
this.comboBoxAdv3.ValueMember = combo1ValueMember;

}

\\ Main Form :

DropDownUser du = new DropDownUser();
du.comboBox1SetValues(dt1, "Eid", "Eid");
du.comboBox2SetValues(dt1, "Name", "Name");
du.comboBox3SetValues(dt1, "Salary", "Salary");



Please find the sample from the following link in which this code has been implemented.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=CustomCellDemo_Modified-1950921555.zip

Please, do let me know if you have any query.

Regards
Ranjeet

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.

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.

;