Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
2281 | Dec 30,2002 04:40 PM UTC | Jan 8,2003 09:05 PM UTC | WinForms | 5 |
![]() |
Tags: GridControl |
////// Sorts tha data object by the specified column. /// /// The column that holds the key for sorting this object. /// The sort direction: asceding or descending /// You should pass in GridModel.Rows.HeaderCount to specify if there are additional headers /// displayed in the grid that should not be sorted. public void SortByColumn(int colIndex, ListSortDirection direction, int extraHeaderCount) { int hc = extraHeaderCount+2; ArrayList sortArray = new ArrayList(); int count = RowCount-extraHeaderCount; for (int n = 0; n < count; n++) sortArray.Add(sfTable.Rows[n+hc]); GridColumnSorter sorter = new GridColumnSorter(colIndex+1, direction, sortArray); sortArray.Sort(sorter); for (int n = 0; n < sortArray.Count; n++) sfTable.Rows[n+hc] = sortArray[n]; }
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.