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.
Unfortunately, activation email could not send to your email. Please try again.

Sorting a range of cells

Thread ID:

Created:

Updated:

Platform:

Replies:

2281 Dec 30,2002 11:40 AM Jan 8,2003 04:05 PM Windows Forms 5
loading
Tags: GridControl
Scott Todd
Asked On December 30, 2002 11:40 AM

Is if possible to sort a range of cells?

Administrator [Syncfusion]
Replied On December 30, 2002 04:16 PM

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.

Scott Todd
Replied On January 2, 2003 12:19 PM

When will the next patch be released? Scott

Administrator [Syncfusion]
Replied On January 3, 2003 12:36 AM

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++)
		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];
}

Scott Todd
Replied On January 8, 2003 11:49 AM

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

Administrator [Syncfusion]
Replied On January 8, 2003 04:05 PM

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

CONFIRMATION

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.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;