Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
540
Underlying Dataset IDataErrorInfo
posted

I'm populating a datatable with rows of data.  As I populate the datarows if certain values are null or invalid I'll set an error using SetColumnError.  Once complete a dataview is created so records can be displayed in a grid in proper sorted order. The column errors and row errors are showing up just fine.  I'm using a rowedittemplate so the user can edit data in the selected row.

The data is broken into sections, for example (FName, MName, LName, Addr, City, State, Zip) these would relate to a column shown as ValidUserInfo (True,False).  Another section would be (Acct Loc, Acct Dept, Acct CostCenter) relating to ValidUserAcct (True, False). 

When a user edits the row, and we'll say corrects the information for demographics, if all cells are filled in I'll change the ValidUserInfo to True but the underlaying cell error exist. 

My question is how do I reference the underlying datarow in the datatable to set the SetColumnError to nothing?

I'm doing this validation in the OK button event that is created when I put the rowedittemplate control is place on the form. 

  • 37774
    Verified Answer
    posted

    You can get the underlying row through the ListObject property of the row (i.e. grid.ActiveRow.ListObject).  I believe that this property will actually be a DataRowView and not just a DataRow when you're bound to a DataTable.

    -Matt