المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : DataRowState not working as expected



C# Programming
05-13-2010, 04:00 AM
Hi,

I'm trying to determine if the row has been modified. I have used Visual Studio 2010 and dragged the controls onto the form, so VS has built everything. When a direction button on the navigator is clicked, I run this code.
x = Convert.ToInt32(reunionBindingNavigator.PositionItem.Text);
DataRow dr = KTReunionDataSet.Reunion.Rows[x];
Debug.WriteLine(dr.RowState.ToString());
if (dr.RowState == DataRowState.Modified)
return;
I start with row one, change the date on the calendar, click next, row 2 is now showing, don't modify anything on row 2, click the back button so we are now on Row 1, yet dr.RowState shows as UnModified.

Did I do something wrong or am I missing something?

Thank you,
Glenn