Developer

AddRow

Add number of rows specified by Count parameter at the end of rows array.

function AddRow(const Count: Integer = 1; IgnoreDefaults: Boolean = True): INxCellsRow; virtual;

Parameters


Count
Integer
Specify number of rows to be added
IgnoreDefaults
Boolean
Skip assigning Column's default values (faster). Default True.
Example:

NextGrid61.AddRow; // add only 1 row NextGrid61.AddRow(10); // add 10 rows NextGrid61.AddRow(10000); // add 10,000 rows
To set default values for cells, using Column's DefaultValue property:

NextGrid61.AddRow(1, False); NexrGrid61.AddRow(50, False);

Remarks


After new row is added, LastAddedRow property is updated to the index of last added row.

Example:

NextGrid61.AddRow; NextGrid61.SelectedRow := NextGrid61.LastAddedRow;
Example:

if Form2.ShowModal = mrOk then begin NextGrid61.AddRow(1, False); NextGrid61.Cell[1, NextGrid61.LastAddedRow].AsString := Form2.Edit1.Text; NextGrid61.Cell[2, NextGrid61.LastAddedRow].AsFloat := Form2.NxSpinEdit1.AsFloat; NextGrid61.Cell[3, NextGrid61.LastAddedRow].AsBoolean := Form2.CheckBox1.Checked; end;

See also