MattMeharry

Hi, I have a loop that is populating label controls from a Datatable. If I simple bind the datarow to the labels' Text property, when I update the Datatable I expected the changes to be reflected in the label. This is true if I bind the the table directly.

// this shows the correct values but they don't update when I update the data in the table
...
templabel.DataBindings.Add("Text", dt.Rows[i ], "state");
...

// when I bind directly to the table, updating the table does reflect the changes. But this option is no good as all my label controls have the same values.
...
templabel.DataBindings.Add("Text", dt, "state");
...


What I'm trying to achieve, is when I update the data in the table the changes are reflected automatically in the bound controls.



Re: Visual C# General Simple binding to Datarow - values don't update???

MattMeharry

I've posted this on three separate forums, doesn't anyone have any ideas