4 Answers, 1 is accepted
0
Hello Alok,
The user is allowed to type text with the GridViewTextBoxColumn and the text cannot be converted to Byte and this is why the exception occurs. It would be better to use GridViewDecimalColumn for this case:
Please let me know if there is something else I can help you with.
Regards,
Dimitar
Progress Telerik
The user is allowed to type text with the GridViewTextBoxColumn and the text cannot be converted to Byte and this is why the exception occurs. It would be better to use GridViewDecimalColumn for this case:
var col =
new
GridViewDecimalColumn();
col.Maximum = 255;
col.Minimum = 0;
col.DataType =
typeof
(
byte
);
col.FieldName =
"ByteColumn"
;
radGridView1.Columns.Add(col);
Please let me know if there is something else I can help you with.
Regards,
Dimitar
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
alok
Top achievements
Rank 1
answered on 19 May 2019, 04:45 AM
Thank you dimitar so much
With this answer my problem has been resolved
0
alok
Top achievements
Rank 1
answered on 19 May 2019, 04:50 AM
Apart from this question, now how can radgridview exceptions be handle
0
Hello Alok,
You can use the DataError event to handle exceptions that occur in the DataSource (e.g. ConstraintException). Such exceptions are handled by the grid and a message box will be displayed. The event allows you to handle this manually. Please note that this will not work for this case and you should always make sure that the user can add a proper values.
Please let me know if there is something else I can help you with.
Regards,
Dimitar
Progress Telerik
You can use the DataError event to handle exceptions that occur in the DataSource (e.g. ConstraintException). Such exceptions are handled by the grid and a message box will be displayed. The event allows you to handle this manually. Please note that this will not work for this case and you should always make sure that the user can add a proper values.
Please let me know if there is something else I can help you with.
Regards,
Dimitar
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.