T
Torbjorn Stavas
Is there a way to change a selected item in a combobox, without
triggering the SelectedIndexChanged event?
I got listener on a few comboboxes, 'cause i want to save the changes
immediately to an instance of say... "foo". But when the user loads
another instance of "foo", i want to set the selecteditem in the
comboboxes to the appropriate values according to the loaded "foo",
without triggering the SelectedIndexChanged event.
I can solve this with the follow code
bool loadingOld = true;
private void comboBox1_SelectedIndexChanged(object sender,
System.EventArgs e)
{
if(!loadingOld)
{
foo.save()
}
}
, but i don't like the look of it.
So is ther anyone that knows if you can change selecteditem without
triggering the SelectedIndexChanged event?
//Kindest regards, Torbjorn
triggering the SelectedIndexChanged event?
I got listener on a few comboboxes, 'cause i want to save the changes
immediately to an instance of say... "foo". But when the user loads
another instance of "foo", i want to set the selecteditem in the
comboboxes to the appropriate values according to the loaded "foo",
without triggering the SelectedIndexChanged event.
I can solve this with the follow code
bool loadingOld = true;
private void comboBox1_SelectedIndexChanged(object sender,
System.EventArgs e)
{
if(!loadingOld)
{
foo.save()
}
}
, but i don't like the look of it.
So is ther anyone that knows if you can change selecteditem without
triggering the SelectedIndexChanged event?
//Kindest regards, Torbjorn