To reproduce:
- Select several rows and cells in excel and copy them.
- Paste in the self-reference grid.
- Only the first row is copied.
Workaround:
private void RadGridView1_Pasting(object sender, GridViewClipboardEventArgs e)
{
e.Cancel = true;
List<List<string>> rows = this.GetTextData();
PrintGridTraverser traverser = new PrintGridTraverser(this.radGridView1.MasterView);
while (traverser.Current != this.radGridView1.CurrentRow)
{
traverser.MoveNext();
}
traverser.MovePrevious();
int rowIndex = 0;
int colIndex = this.radGridView1.CurrentColumn.Index;
while (traverser.MoveNext() && rowIndex < rows.Count)
{
for (int i = colIndex; i < this.radGridView1.Columns.Count && i - colIndex < rows[rowIndex].Count; i++)
{
traverser.Current.Cells[i].Value = rows[rowIndex][i - colIndex];
}
rowIndex++;
}
}