DataViews are the way to go to bind to DataGrids (even when you bind a DataGrid to a DataTable, behind the scenes, the grid is actually bound to a DataView). The DataView has a RowFilter property you can set to filter the rows in your DataTable. You can also use the RowStateFilter property to filter on the row state (modified, deleted, etc.) of your datarows.
DataView dv = new DataView(MyDataSet.Tables[0]);
dv.RowFilter = "accepted=1";
>All,
>
>I stumbled across a way to filter records in a DataSet via
>
>DataRow[] MyRow = MyDataSet.Tables[0].Select("accepted=1");
>
>
>What I am doing is presenting the user with all of the requests they have made. If they press 'Accepted', I want to filter out the accepted records from the dataset and present them in a grid
>
>I would like to use this new cursor as a DataSource for a grid. However, when I try to assign it, it says it cannot find the PK, so I am guessing it does not support the IEnumerator interface.
>
>"DataBinder.Eval: 'System.Data.DataRow' does not contain a property with the name pk_crfp."
>
>
>Can I convert DataRow[] to a DataSet? Or what would be the recommended way to go work this?
>
>TIA,
>Doug
-----------------------------------------
Cathi Gero, CPA
Prenia Software & Consulting Services
Microsoft C# / .NET MVP
Mere Mortals for .NET MVP
cgero@prenia.comwww.prenia.comWeblog: blogs.prenia.com/cathi