FMXGrid pasting question

Hi,

I'm just learning FMXGrid.  Is it possible to replicate copied cells to multiple rows when pasting?  I'd like to copy several cells from one row, and replicate them to several rows, for instance copy row0 to rows 1-5, duplicating the contents of row0 in rows1-5.  Thanks in advance.

Hi, 


You can select multiple cells when setting the SelectionMode to smCellRange and then copy and paste all selected cells. There is no support to copy one cell to multiple cells though, you'll need to manually copy to each cell separately.

The OnClipboardPaste event might be helpful.  What is the easiest way to get the complete multi-row destination range?  If I select row3/column1 through row6/column4 as the destination cells, OnClipboardPaste shows the range as row3/column1 through row3/column4 and I need to know the entire range selected.  Thanks in advance.

For anyone who's interested, this works:
// Called after all data pasted, Cells is range of cells pasted, not all selected cells
void __fastcall TTopForm::EditGroupGridClipboardPaste(TObject *Sender, TCellRange &Cells)
{
    // Save starting and ending rows
  // Columns used as-is
    int start = EditGroupGrid->Selection.StartRow;
    int end = EditGroupGrid->Selection.EndRow;
    TCellRange rng;
  // Columns are the same for all rows
    rng.StartCol = Cells.StartCol;
    rng.EndCol = Cells.EndCol;
    for (int i = start+1; i <= end; i++)
    {
        // Paste to next row
        rng.StartRow = rng.EndRow = i;
        EditGroupGrid->SelectCells(rng);
        // Paste same data to every row
        EditGroupGrid->PasteFromClipboard();
    }
    // Restore original selection
    rng.StartRow = start;
    rng.EndRow = end;
    EditGroupGrid->SelectCells(rng);
}

Hi, 


Thank you for your feedback on this matter.