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. Image for the cookie policy date
close icon

how to create gridcontrols cell model with 3 combo-boxes

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

1 Reply

RK Ranjeet Kumar Syncfusion Team December 11, 2009 12:59 PM UTC

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

Loader.
Live Chat Icon For mobile
Up arrow icon