This is a migrated thread and some comments may be shown as answers.

Grid DataSource with Null values throws error

2 Answers 189 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ramesh
Top achievements
Rank 1
Ramesh asked on 10 Dec 2008, 07:02 PM
The datasource for my RAD Grid is a datatable with a column that is typed to System.Double. This column allows null. However when this datatable is bound to the grid it results in a

Conversion from type 'DBNull' to type 'Integer' is not valid

error. I am unable to trace the exact line where this error is raised. How do I specify that a grid column can have null data. If the column type is System.String, then the grid can handle nulls as designed. For numeric columns with nulls the grid bombs

Please advise

TIA



2 Answers, 1 is accepted

Sort by
0
Sebastian
Telerik team
answered on 15 Dec 2008, 01:41 PM
Hi Ramesh,

Can you please check whether the same error is generated when binding your source field column to a regular MS GridView instance on the page? If the exception is raised with RadGrid only, I will appreciate if you prepare a small working project, illustrating the abnormality, and send it enclosed to a formal support ticket. We will test/debug it locally and will get back to you with our findings.

Kind regards,
Sebastian
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Ramesh
Top achievements
Rank 1
answered on 15 Dec 2008, 01:53 PM
Sebastian
Thank you for your response. During the course of creating a sample project to reproduct the issue, I discovered that the error was in fact in my code and not the grid. The crytpic error message regarding DBNull and not seeing the break happen in my code led me on a tangent to suspect the issue to be in Telerik code. I have fixed my code and now the grid is working as intended

thanks
ramesh
Tags
Grid
Asked by
Ramesh
Top achievements
Rank 1
Answers by
Sebastian
Telerik team
Ramesh
Top achievements
Rank 1
Share this question
or