Phylum123 Posted November 29, 2002 Posted November 29, 2002 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 Quote
*Experts* Bucky Posted December 2, 2002 *Experts* Posted December 2, 2002 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. Quote "Being grown up isn't half as fun as growing up These are the best days of our lives" -The Ataris, In This Diary
wyrd Posted December 2, 2002 Posted December 2, 2002 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. ;) Quote Gamer extraordinaire. Programmer wannabe.
Mothra Posted December 2, 2002 Posted December 2, 2002 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 Quote Being smarter than you look is always better than looking smarter than you are.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.