Event.Form.MainGrid.RecordNumber
.RecordNumber returns the row of the selected, or highlighted row in a grid. The .RecordNumber value is not available until the event's Event.Base(); runs. The first record in a grid is 0. The
Note: The .RecordNumber will not work when the request to capture it appears on a double-click event because Deacom will have moved to the new form before the .RecordNumber could be returned.
Applies To
Properties and Methods
None
Available
The .RecordNumber property is available in:
- 15.04.059
- 15.05.034
- 16.00.039
- All newer builds
Note: The .RecordNumber property and all sub-classes, properties, and methods are only available in Form Layout scripts.
Type
Int32
Syntax
Event.Form.MainGrid.RecordNumber;
Parameters
None
Example
//--Add this script to a grid click event
Event.Base();
var lpMainGrid = Event.Form.MainGrid;
Event.Form.MessageBox('Selected Grid Row Number is: ' + lpMainGrid.RecordNumber);
/* Expected Prompt response when clicking a row in the grid (assuming it is the first row):
Selected Grid Row Number is: 0
*/