nRowInserted = MTblInsertChildRow( hWndTbl, nrParentRow, nOptionFlags )

Inserts a row as a child of another row.

Parameters
hWndTbl
Window Handle: Handle of the table

nrParentRow
Receive Number: Desired parent row. If the function succeeds and the parent row was moved due to row insertion, it contains the new parent row number.
If row insertion succeeds but M!Table is unable to set the desired row as parent, it contains TBL_Error.

nOptionFlags
Number: Optional flags:

MTICR_REDRAW

Redraws the table

MTICR_FIRST

The new row will be the first child of the parent row. If you don't set this flag, the new row will be the last child of the parent row.

Return
Number: Number of the new row if a row was inserted, otherwise TBL_Error.

Example
In this example 5 child rows are added to a parent row:

Set nParentRow = 10
Set n = 0
While n < 5
  Call MTblInsertChildRow( hWndTbl, nParentRow, MTICR_REDRAW )
  Set n = n + 1

Remarks
If the parent row is not expanded, the ROW_Hidden flag is set for the inserted row.
It's not necessaray that the parent row already has child rows.
If the inserted row is the first child row of the parent row, the row flag MTBL_ROW_CAN_EXPAND is set for the parent row.
If the parent row is a part of merged rows and the inserted row is the first child row, the child row is inserted outside the merged rows.

See also
Tree view

Created with the Personal Edition of HelpNDoc: Easily create PDF Help documents