Simple Databinding to Datarow, values not updating
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");
...
Thanks!
|