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

C# Code Snippet: Use of the DataTable NewRow() Method and the DefaultView Property

/* This snippet modifies the data source of a ComboBox in a custom DataGrid Column Style (featuring a ComboBox). The keyword this references this Style.

Note that a DataView object comes by default (DefaultView) in the DataTable
object. This makes sorting on the fly possible with one line of code.

*/ DataRow dRow = p_dataTable.NewRow(); dRow[p_valueMember] = DBNull.Value; dRow[p_displayMember] = this.NullText; p_dataTable.Rows.Add(dRow); p_dataTable.DefaultView.Sort = p_displayMember;

mod date: 2004-06-04T22:06:34.000Z