Programic Datagrid

Phylum123

Newcomer
Joined
Feb 26, 2002
Messages
9
I want to know how to programically tell a datagrid to sort by one of its columns and which way to sort (Asc or Dsc), is this possible?

Phylum
 
You have to load the table into a DataView, set the
DataView's Sort property to "ASC ColumnName" or "DESC
ColumnName", and bind the now-sorted DataView back to the
grid.
 
Well a DataGrid has to have a source in which it is bound to correct? To display sorted info by a column should be as easy as sorting the source itself. At least, one would hope. ;)
 
Bound DataGrid...

You don't necessarily have to bind a data grid to a data source. You can create the record set (or source) and then add the data to the grid programaticlly. In that case, I would just sort and/or re-sort the source and either re-fill or refresh the grid as needed
 
Back
Top