Spread 8.0 Documentation
SortKey Property
Support Options
ActiveX Reference > ActiveX Properties > SortKey Property

Glossary Item Box

SortKey Property


See Also    DLL    Example

Applies To

fpSpread control

Description

Sets or returns the column or row to sort by. This property is available at run time only.

Syntax

C++

long CSpreadSheet::GetSortKey(short Index);
void CSpreadSheet::SetSortKey(short Index, long value);

Visual Basic

[form.]fpSpread.SortKey(nIndex As Integer)[ = value&]

Remarks

The index used in the code refers to the sort key; that is, the order in which to perform the sort. The index for the first sort key is 1. Specify the sort key as the index; then set the property equal to the row or column number to sort by. You can use up to 256 sort keys.

This setting is applied to the current sheet setting unless you first set the Sheet property to specify the sheet for which you are setting the property.

To sort the sheet, use the Sort method, and specify whether to sort columns or rows by setting the SortBy parameter. You can then use the SortKeys and SortKeyOrders parameters to specify the keys and how they are sorted, or you can use this property and the SortKeyOrder property. If you use this property and the SortKeyOrder property, you need not specify settings for the SortKeys and SortKeyOrders parameters in the Sort method.

Spread Designer

Spin box under Settings Key n, Sort Key List box, Set button, and Remove button in the Sort Settings dialog box.

You must select a range of cells before you can display the Sort Settings dialog box.

First select an option button under Sort by to determine whether to sort columns or rows. Next set the spin box under Settings Key 1, to the row or column you want to sort by. Choose the Set button to assign your options as the first sort key. Your sort key will appear in the Sort Key List. Repeat the steps to assign additional sort keys. Choose the Remove button to remove a sort key from the Sort Key List.

Data Type

Long Integer

See Also

Sorting Data

Sheet, SortKeyOrder properties

Sort method

DLL Correspondence

SSSort function

Copyright © GrapeCity, inc. All rights reserved.