- Make a datatable with a string-column with a max. length of 10 characters.
- Will the datatable with some data.
- Bind it to a RadGridView
- In Excel (or another applicatie) create a now table with some strings, this time longer that 10 characters.
- Paste this data from Excel to the RadGridView
- The strings that are to long will either cause an exception or they are truncated.
- The string with the value that is to long is skipped during pasting.
In the method MasterGridViewTemplate.PasteDataToRow the next piece is code is located:
if (CurrentView.ViewTemplate.Columns[columnIndex].DataType == typeof(string))
if (column is GridViewTextBoxColumn viewTextBoxColumn && viewTextBoxColumn.MaxLength > 0 && rowData[rowIndex].Length > viewTextBoxColumn.MaxLength)
obj = rowData[rowIndex].Substring(0, viewTextBoxColumn.MaxLength);
The property viewTextBoxColumn.MaxLength
returns 32767 (and not 10) which is clearly a related and possibly a separate bug.