Hi,
I have question. I have form, on form I gave DataGridView (DGV) on top form and below I have TextBoxes (TB), DatetimePicker. All control bounded to same DataTable. DataGridView can not edit,delete or insert records and designed only to facilitate traversing though rows. all operation to be done in "detail" area which consists Textboxes
So when I just traversing trough records using DGV. I click on three out six record in my DGW. When click on datarow in DGV all values immediately reflected in TB below. Now I click button which run this code
Code Block
private void button1_Click(object sender, EventArgs e)
{
foreach (DataRow dr in this.dsPerson.dtPerson.Rows)
{
Console.WriteLine(dr["Id"] + " | "+ dr.RowState.ToString());
}
}
So it will tell me that all rows which I touched are Modified and rest are Unmodified. Why is that?
My user wants that program checked whether he changed something and forgot to save to I should check from code whether any row got modified but it hard to get truth. As workaround I an checking for Modified record Current and Proposed values for fields, it works butit isreally overkill.
I would appreciate if somebody put some light on it.
Thanks