MGEditChangeRows

Top  Previous  Next

This event is fired when an action - adding, updating, or deleting row(s) - occurs for the grid in edit mode.

[Visual Basic .NET]

Public Event MGEditChangeRows(ByVal s As Object, ByVal e As EditChangeRowsEventArgs)

[C#]

public event MGEditChangeRows(object s, EditChangeRowsEventArgs e);

Parameters

s

    Specifies the sender object.

 

e

    is the object of EditChangeRowsEventArgs Class with the following members:

1.Done indicates whether the event subscriber has finished processing rows or not. The initial value is FALSE, the subscriber should set it to TRUE after everything is done.

2.GridIndex specifies the index of working grid, -1 for the full grid or the grid index for the working sub grid between 0 and the return value of GetTotalSubGrids() minus 1.

3.RowsList is the object of ArrayList containing all related rows - 1 row for adding and deleting, potentially more than 1 row for updating. For more information, please refer to Remarks.

 

 

Remarks

Each item of RowsList is the object of EventEditGridRow Class containing the members below:

1.Flag indicates the action type - 1 for adding, 2 for updating, and 3 for deleting.

2.SectionIndex specifies the index (0-based) of the section where the operation occurs for the full grid. If the AllowSections is set to FALSE, this parameter becomes irrelevant. Otherwise the members in red become irrelevant, as there is no ambiguity on which sub grid is used to insert a new sync row when a new row is inserted into the full grid with the AllowSections set to TRUE, and the sub grid is uniquely determined by this member.

3.OnBorder indicates whether the newly added row lies on the border of 2 adjacent sub grids or not. If a new row is inserted into the full grid and a sync row should be inserted to the associated sub grid, MegaGrid needs to find out which sub grid to add it. For example, if the property RowsCount is 17, there are 4 sub grids containing 3, 5, 2, and 7 rows respectively. If a new row is inserted into position 7 (0-based) of the full grid, which is the border position between 2nd (0-based index 1) and 3rd (0-based index 2) sub grid, this field is set to TRUE. Otherwise it is set to FALSE. If a new row is inserted to a sub grid, this field is always set to FALSE.

4.UseNextCopyGrid specifies whether to use next sub grid to insert a new crow. It becomes irrelevant if OnBorder is FALSE.

5.CopyGridIndex specifies the index (0-based) of sub grid where to insert a sync row if a new row is inserted into the full grid.

6.CopyRowIndex specifies the position (0-based) of a sync row in the sub grid indicated by CopyGridIndex.

7.NextCopyGridIndex specifies the index (0-based) of next sub grid where to insert a sync row if a new row is inserted into the full grid. If OnBorder is FALSE, this field value is equal to CopyGridIndex.

8.NextCopyRowIndex specifies the position (0-based) of a sync row in the next sub grid indicated by NextCopyGridIndex. If OnBorder is FALSE, this field value is equal to CopyRowIndex.

9.Tag specifies the Tag property of working row. If the row is a new one, it is null.

10. RowIndex specifies the position (0-based) of working row in the working grid - either the full grid or a sub grid.

11. MainRowIndex specifies the position (0-based) of sync row for the working row in the working grid. If the working grid is the full grid, this field value is equal to RowIndex.

12. Success indicates whether the subscriber has successfully finished processing the working row.

13. Message contains the error information sent back to MegaGrid if something is wrong and Success is set to FALSE.

14. CellsList is the object of ArrayList containing all related working cells.

 

 

Each item of CellsList is the object of EventEditGridCell Class containing the members below:

1.ColumnName specifies the column name of working cell.

2.OrigColumnIndex specifies the original column index of working cell.

3.CurrColumnIndex specifies the current column index of work cell. This field is probably different from OrigColumnIndex after swapping columns.

4.OldValue specifies the old value of working cell.

5.NewValue specifies the new value of working cell.