V
Viraptor
Hello
I've created a form with 2 listboxes. Both have data-binding. First one
is "normal", 1:1 view of table. Second is filled using parameter from
the first one.
this.xxxTableAdapter.Fill(this.mainDataSet.XXX,
(int)this.BindingContext[yyyBindingSource, "id"].Current);
When I do it in Form_Load() it shows first listbox with element with
"id" of value 2 selected, but this.BindingContext[yyyBindingSource,
"id"].Current == 1. When I do the same thing in
yyyBindingSource_CurrentChanged later it gives expected results.
How can I fix the behaviour just after window creation? I guess it's
connected with listbox not initialized properly with new data between
those two .Fill() calls.
I've created a form with 2 listboxes. Both have data-binding. First one
is "normal", 1:1 view of table. Second is filled using parameter from
the first one.
this.xxxTableAdapter.Fill(this.mainDataSet.XXX,
(int)this.BindingContext[yyyBindingSource, "id"].Current);
When I do it in Form_Load() it shows first listbox with element with
"id" of value 2 selected, but this.BindingContext[yyyBindingSource,
"id"].Current == 1. When I do the same thing in
yyyBindingSource_CurrentChanged later it gives expected results.
How can I fix the behaviour just after window creation? I guess it's
connected with listbox not initialized properly with new data between
those two .Fill() calls.