Spread 8.0 Documentation
BeforeUserSort, ScriptBeforeUserSort Events
Support Options
ActiveX Reference > ActiveX Events > BeforeUserSort, ScriptBeforeUserSort Events

Glossary Item Box

BeforeUserSort, ScriptBeforeUserSort Events


See Also

Applies To

fpSpread control

Description

Occurs when one of the following occurs:

and the UserColAction property is set to 1 (Sort) or 2 (SortNoIndicator).

Syntax

C++

afx_msg void OnBeforeUserSortfpSpread(long Col, long State, long FAR* DefaultAction);

Visual Basic

Event fpSpread_BeforeUserSort(ByVal Col As Long, ByVal State As Long, DefaultAction As Long)

Note: The ScriptBeforeUserSort event uses the same syntax except event parameters that are not passed "ByVal" are declared as variants. For more information on Script events, see Scripting Environment Usage.

Parameters

The following parameters are available:

Parameter Description
Col Column on which sort will occur
State Current sort state
Value Constant Description
0 BeforeUserSortStateNone Not sorted
1 BeforeUserSortStateAcending Ascending sort
2 BeforeUserSortStateDescending Descending sort
DefaultAction Action that will occur
Can be set to one of the following values:
Value Constant Description
0 BeforeUserSortDefaultActionCancel Cancel sort
1 BeforeUserSortDefaultActionAutoSort Sort will occur automatically
2 BeforeUserSortDefaultActionManualSort Sort will occur manually

Remarks

If you set the DefaultAction parameter to 2, you should provide code in this event to manually sort the data.

After the sort is completed, the AfterUserSort event occurs.

Use the SheetSendingEvent property if you want to return the sheet for which this event occured.

Note: This event will occur if you use the fpSpread control in a scripting environment (for example, Microsoft's Visual InterDev or Internet Explorer) or a non-scripting environment. However, if you want to use the fpSpread control in a scripting environment and you want to change any parameter that is not passed "ByVal", you must set the ScriptEnhanced property to True and use the ScriptBeforeUserSort event. ScriptBeforeUserSort event parameters that are not passed "ByVal" are declared as variants.

See Also

Allowing Users To Sort By Columns

ColUserSortIndicator, ScriptEnhanced, SheetSendingEvent, UserColAction properties

AfterUserSort event

Copyright © GrapeCity, inc. All rights reserved.