first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

Windows Forms: A DataGrid Bound "Directly" to a DataTable Is Actually Using the DefaultView; Disappearing New Rows

A DataGrid bound "directly" to a DataTable is actually using the DefaultView property of the DataTable. It follows that the RowFilter, RowStateFilter and Sort properties of the DefaultView suddenly become very important in the explanation of why new rows added to your DataGrid suddenly disappear as soon as they are left out of focus.

To insure that the grid behaves somewhat predictably, this static member helps:

internal static void DataDefaultView(DataView TargetDefaultView)
{
    TargetDefaultView.RowFilter = String.Empty;
    TargetDefaultView.RowStateFilter = DataViewRowState.CurrentRows;
    TargetDefaultView.Sort = String.Empty;
}
mod date: 2004-07-11T19:56:22.000Z