Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
91974 | Dec 10,2009 09:13 PM UTC | Dec 11,2009 12:59 PM UTC | WinForms | 1 |
![]() |
Tags: GridControl |
\\ 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");
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.
or the page will be automatically redirected to sign-in page in 10 seconds.