I have a datagrid in a windows forms application. The datagrid gets its
data via a web service. Users can modify rows in the datagrid then post
their changes. However, when changes are made the rowstate remains
"Added" for all the rows--those that were modified AND those that were
unchanged. Here is the code I am using to test (dsitems is the
underlying dataset):
private void btnSave_Click(object sender, System.EventArgs e)
{
string res=string.Empty;
foreach(DataRow dr in dsitems.GetChanges().Tables[0].Rows)
{
res+=String.Format("{0}|{1}|{2}\n",
dr["pagetitle"],
dr["pagelocation"],
dr.RowState.ToString()
);
}
lblresults.Text=res;
}
Any ideas as to why the rowstate is always set to "Added" ?
*** Sent via Developersdex http://www.developersdex.com ***