combo item changed with the selected value
Posted: Tue May 14, 2013 6:11 am
Hi, I have two comob Box , one is countries , another is states , when the user change the country , the state will be changed depending on which country is selected .
I have done it like:
cmbxStates.Items.Clear();
SelectedCountry = cmbxCountries.SelectedItem.ToString();
StatesDataSource.Disconnect();
StatesDataSource.ResetData();
StatesDataSource.Connect();
foreach (DataRow row in StatesDataSource.DataTable.Rows)
{
cmbxStates.Items.Add(row["State"]);
}
But I have lots of report (mrt file) have similar requirements, maybe it is Kind and sub-kind or State-code zip , is there any way to do this in a function or high level ,such as class inherited ,Control Extension ect.
Thanks.
I have done it like:
cmbxStates.Items.Clear();
SelectedCountry = cmbxCountries.SelectedItem.ToString();
StatesDataSource.Disconnect();
StatesDataSource.ResetData();
StatesDataSource.Connect();
foreach (DataRow row in StatesDataSource.DataTable.Rows)
{
cmbxStates.Items.Add(row["State"]);
}
But I have lots of report (mrt file) have similar requirements, maybe it is Kind and sub-kind or State-code zip , is there any way to do this in a function or high level ,such as class inherited ,Control Extension ect.
Thanks.