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

Glossary Item Box

SortKeyOrder Property


See Also    DLL    Example

Applies To

fpSpread control

Description

Sets or returns for the column or row by which you are sorting whether to sort in ascending or descending order. This property is available at run time only.

Syntax

C++

long CSpreadSheet::GetSortKeyOrder(short Index);
void CSpreadSheet::SetSortKeyOrder(short Index, long value);

Visual Basic

[form.]fpSpread.SortKeyOrder(nIndex As Integer)[ = setting%]

Remarks

The following settings are available:

Setting Description Constant
0 - None Does not sort SortKeyOrderNone
1 - Ascending (Default) Sorts in ascending order SortKeyOrderAscending
2 - Descending Sorts in descending order SortKeyOrderDescending

The index used in the code refers to the sort key. The index for the first sort key is 1. Specify the sort key you are working with as the index, and then set the property equal to one of the three enumerated settings.

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 the SortKey property and this property. If you use the SortKey property and this property, you need not specify settings for the SortKeys and SortKeyOrders parameters in the Sort method.

Spread Designer

Option buttons under Settings Key n 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

Integer (Enumerated)

See Also

Sorting Data

Sheet, SortKey properties

Sort method

DLL Correspondence

SSSort function

Copyright © GrapeCity, inc. All rights reserved.