Hi,
I am fixing a bug in an existing c# windows application.
The problem is to do with binding the checkbox control which is called chkFName.
If for the first time, I select a row in the DataGridView (DGV), then the chkFName shows ticked or unticked according to one of the fields in the DGV, BUT if I select a different row in the grid, then the state of the chkFName still remains as it was before and therefore it does not show the state of the new field in the chkFName.
Do you know what is going wrong in the code please?
Thanks
There is bindingsource control used for databinding the controls to the data...
Bindingsource is called MyBS
The controls are being bound to the data as follows:
dt = DataGet(mID);
MyBS.DataSource = dt;
dGV.DataSource = MyBS;
dGV.AutoGenerateColumns = false;
dGV.Columns[i++].DataPropertyName = "PB";
...
...
...
dGV.Columns[i++].DataPropertyName = "FName";
txtPB.DataBindings.Clear();
...
...
...
chkFName.DataBindings.Clear();
tbPB.DataBindings.Add(new Binding("Text", this.MyBS, "PB", true));
...
...
...
chkFName.DataBindings.Add(new Binding("Checked", this.MyBS, "FName", true));