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

مشاهدة النسخة كاملة : Filter BindingSource to show only datarows containing errors



C# Programming
06-02-2009, 03:32 PM
Can anyone give advice on how to do this?

I am using a DeveloperExpress Grid linked to a BindingSource.

I import data into the bindingsource from a flat file then perform various checks to ensure the data is valid. If not, I set a column error for the row - as follows...

if (view.GetRowCellValue(intRow, "intX") == null || Convert.ToDouble(view.GetRowCellValue(intRow, "intX")) == (double)0.00)
{
dr.SetColumnError("intX", String.Format("{0}: Missing value.", view.Columns["intX"].Caption));
}

I have a button on the form to allow the user to filter the grid so that the grid will hide all valid rows to allow them to concentrate on fixing the invalid rows.
Can someone tell me how to apply a filter to the binding source to only show those rows with one or more column errors?

Many Thanks