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

Binding DataTable with integer column names

1 Answer 50 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Vinod
Top achievements
Rank 1
Vinod asked on 11 Jul 2014, 04:25 PM
I have a GridView bound to a DataTable. The DataTable contains columns with 'integer' names. e.g. "2000", "2014" etc.

When I try to edit a cell in the GridView, I'm shown an error: Cannot find column 2000.

I suspect this is because the column name is parsing to an int somewhere internally. When I change to column name to something like "x2000" then it works fine.

Are there any workarounds for this?

1 Answer, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 16 Jul 2014, 12:58 PM
Hi,

In order to overcome this exception you can set GridView's ValidatesOnDataErrors property to None.

Please give it a try and let me know how it works for you.

Regards,
Yoan
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
Tags
GridView
Asked by
Vinod
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Share this question
or