ChangeOrdering - cDbCJGrid
Used to change the ordering of an active grid
Type: Procedure
Parameters
| Parameter | Type | Description |
|---|---|---|
| iOrdering | Integer | The new index order |
| bDescending | Boolean | Set true to reverse the index order |
Syntax
Procedure ChangeOrdering Integer iOrdering Boolean bDescending
Call Example
Send ChangeOrdering iOrdering bDescending
Description
ChangeOrdering can be used to change the order of an active grid. It does this by setting Ordering and pbReverseOrdering, updating the datasource with this change and calling RefreshDataFromSelectedRow to refresh the grid in the new order.
This is called by ReorderGridByColumn, which is called by HeaderReorder, which is called when clicking on a header column.
You probably do not want to call this if your grid is static (pbStaticData is true), as this will reload and refresh your grid. Static grids are sorted by calling SortGridByColumn.
After a grid is activated, changing Ordering does not change the grid's order. You must use ChangeOrdering.
Sample
This sample shows how to change the default ordering of a grid.
This code will reorder a grid by index 1 and in descending order. This can be used in cDbCJGrid and cDbCJGridPromptList classes. Add the code directly to the grid object.
Procedure Activating
Forward Send Activating
Send ChangeOrdering 1 True
End_Procedure