We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

SfCellGrid does not fire CommitCellInfo when pasting multiple cells

Steps to reproduce:

1) Hook SfCellGrid's
 CommitCellInfo & QueryCellInfo:
CellGrid.Model.CommitCellInfo += RowList_CommitCellInfo;
CellGrid.Model.QueryCellInfo += RowList_QueryCellInfo;

2) Enter some dummy data into the grid
3) Copy this data selecting more than 1 cell
4) Paste these cells into another part of the grid
5) Notice RowList_CommitCellInfo info is not fired, my data source cant be updated with the pasted values.

1 Reply

JN Jayaleshwari N Syncfusion Team January 16, 2019 04:19 AM

Hi John Dye,  
Thanks for contacting Syncfusion Products. 
We have checked the reported query “SfCellGrid does not fire CommitCellInfo when pasting multiple cells” from our side. You can achieve the requirement of updating the pasted values in data source by invoking ClipboardCopy and ClipboardPaste Events of SfCellGrid.  
grid.Model.ClipboardCopy += Model_ClipboardCopy;  
grid.Model.ClipboardPaste += Model_ClipboardPaste;  
private void Model_ClipboardCopy(object sender, GridCutPasteEventArgs e)  
    copiedRange = e.Range;  
private void Model_ClipboardPaste(object sender, GridCutPasteEventArgs e)  
    //Updating the copied values in the list.  
    List<string> values = new List<string>();  
    for(int i = copiedRange.Top; i <= copiedRange.Bottom; i++)  
        for (int j = copiedRange.Left; j <= copiedRange.Right; j++)  
            values.Add(grid.Model[i, j].CellValue.ToString());  
You can refer the following user guide documentation to know more  about the copy and paste operations.  
Note: CommitCellInfo Event of SfCellGrid will not be invoked for Clipboard operations.  
Please let me know if you would require further assistance. 
Jayaleshwari N. 

Live Chat Icon For mobile
Up arrow icon