DataRow RowError - Detecting at Table Level.

  • Thread starter Thread starter ChrisM
  • Start date Start date
C

ChrisM

Hi,

I have a DataTable. When the table is validated, I'm setting the
DataRow.RowError text for certain rows that don't match a particular
criteria. This puts a nice red '!' on the DataGrid that is displaying the
DataTable.

Later on, I want to check to see if there are any 'faulty' rows in the
datatable. Is there a way to to a single check at the table level, or do I
need to loop through each row and see if the RowError text is set?
What I'm really looking for is somthing like a DataTable.HasErrorRows
property...

Anyone able to help?

Using C#, VS2003 and DotNET Framework 1.1 SP1

Thanks,

Chris.
 
ChrisM said:
Hi,

I have a DataTable. When the table is validated, I'm setting the
DataRow.RowError text for certain rows that don't match a particular
criteria. This puts a nice red '!' on the DataGrid that is displaying the
DataTable.

Later on, I want to check to see if there are any 'faulty' rows in the
datatable. Is there a way to to a single check at the table level, or do I
need to loop through each row and see if the RowError text is set?
What I'm really looking for is somthing like a DataTable.HasErrorRows
property...

Anyone able to help?

Using C#, VS2003 and DotNET Framework 1.1 SP1

Thanks,

Chris.

Ok, answered my own question. Seeing as no-one else could be bothered...
:-)

Should have looked more carefully I guess, not really sure how I missed this
before.
DataTable has a 'GetErrors' method which returns an array of any DataRows
that have an error set. A check of GetLength(0) for this array will, of
course, tell me if there ARE any rows with an error.

Chris.
 
Back
Top