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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to stop the errors thrown when pasting larger clipboard contents in a GridDataBoundGrid?


A IndexOutOfRangeException is thrown when trying to paste clipboard contents that are greater than the number of columns and rows that are available to accommodate the contents. To stop the exception, a condition check in the Model.PasteCellText handler will do good.


private void Model_PasteCellText(object sender, Syncfusion.Windows.Forms.Grid.GridPasteCellTextEventArgs e)


if(e.RowIndex >= this.gridDataBoundGrid1.Model.RowCount)


MessageBox.Show("There is no enough rows to paste the rest of the contents");

e.Cancel = true;

e.Abort = true;




Private Sub Model_PasteCellText(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridPasteCellTextEventArgs)

If e.RowIndex >= Me.gridDataBoundGrid1.Model.RowCount Then

MessageBox.Show("There is no enough rows to paste the rest of the contents")

e.Cancel = True

e.Abort = True

End If

End Sub

Here is a sample that illustrates this:


Article ID: Published Date: Last Revised Date: Platform: Control:
670 04/30/2011 07/10/2014 WinForms GridDataBoundGrid(Classic)
Did you find this information helpful?
Add Comment
You must log in to leave a comment

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon