To reproduce:
- Add GridViewTextBoxColumn and set the MaxLength property.
- Paste in data row while the is not in edit mode.
Workaround:
private void RadGridView1_Pasting(object sender, Telerik.WinControls.UI.GridViewClipboardEventArgs e)
{
if (radGridView1.CurrentColumn.Name == "column1")
{
GridViewTextBoxColumn col = new GridViewTextBoxColumn();
var lenght = col.MaxLength;
if (Clipboard.ContainsData(DataFormats.Text))
{
e.Cancel = true;
string data = Clipboard.GetData(DataFormats.Text).ToString();
radGridView1.CurrentCell.Value = data.Substring(0, lenght);
}
}
}