As it turns out, there is no Dataset.Sort command, but there is this.
DataRow[] SortedRows = JobsDataTable.Select("isOpen = 1", "jobOrderID desc");
This gives back a sorted (and also filtered) array of DataRows based on the criteria you use.
Now, you can't databind to a DataRow array, but if you are using databinding, the DataGrid or DataGridView can filter and sort for you, so you wouldn't need to use this technique.
Bryan Valencia is a contributing editor and founder of Visual Studio Journey. He owns and operates Software Services, a web design and hosting company in Manteca, California.
No comments:
Post a Comment