We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Sorting a range of cells

Is if possible to sort a range of cells?

5 Replies

AD Administrator Syncfusion Team December 30, 2002 09:16 PM UTC

Currently this is not supported for an abritrary ranges. Sorting will be enhanced in future releases. In the next patch, SortByColumn will be overloaded to allow arbitrary number of frozen rows to remain fixed at the top of the grid. Further enhancements will be in future releases.

ST Scott Todd January 2, 2003 05:19 PM UTC

When will the next patch be released? Scott

AD Administrator Syncfusion Team January 3, 2003 05:36 AM UTC

There is currently no announced date for the next patch release. If you need to ability to fix multiple header rows during a sort, and have access to the source code, you can add the method below in the GridData.cs file where the other SortByColumn methods appear.
/// 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++)
	GridColumnSorter sorter = new GridColumnSorter(colIndex+1, direction, sortArray);
	for (int n = 0; n < sortArray.Count; n++)
		sfTable.Rows[n+hc] = sortArray[n];

ST Scott Todd January 8, 2003 04:49 PM UTC

What if I do not have fixed headers but want to sort complete rows by one column. Can I do this currently? Scott

AD Administrator Syncfusion Team January 8, 2003 09:05 PM UTC

Scott, I don't understand what you want. Can you give some more details or a sample? Clay

Live Chat Icon For mobile
Up arrow icon