Simple:
I have a ComboBox (DropDownList style) that determines
what record is shown. Once it changes I populate the
other form controls with the values from the
corresponding record(s) of the DataSet.
And after all the changes the user has an option to
either Apply the changes or discard them.
And I have a strong feeling against Data Binding since
early VB versions binding meant that you do not have full
control of what is happening with your data. I still
believe that this is the case with .Net and therefore try
to avoid that as much as possible.
But the question still remains unanswered...
Thanks anyhow for all your time answering this.
[quoted text, click to view] >-----Original Message-----
>Sergey,
>
>Well, since you've found a workaround for your problem,
I guess it doesn't
>matter so much to figure out what was happening.
However, I think if you had
>used DataBinding, it probably would have gone a lot
smoother.
>
>I guess I don't understand why you *didn't* data bind,
since you are using a
>DataSet. But, anyway, that's just my 2 cents.
>
>~~Bonnie
>
>"Sergey Poberezovskiy" wrote:
>
>> Bonnie,
>>
>> As I needed to move forward, I had to declare (string
or
>> bool) variables for each such control and set them to
the
>> controls' values before setting any of the row's
>> columns... and then reset the controls' values back to
>> those variables once I populated the row's columns.
Not
>> the quickest and cleanest way though...
>>
>> string cbo1Value = cbo1.Text;
>> bool chk1Value = chk1.Checked;
>> ....
>> row.Field1 = cboValue1; // as soon as this line is
>> executed the values in DropDown combos and checks are
>> reset to defaults ?!?!
>> row.Field2 = chkValue2;
>> ....
>> cbo1.Text = cbo1Value;
>> chk1.Checked = chk1Value;
>>
>> The typed dataset uses the generated code - I use
VS2003
>> Enterprise Architect - not sure what could have gone
>> wrong?...
>
>.