Binding DataTable with integer column names

2 posts, 0 answers
  1. Vinod
    Vinod avatar
    23 posts
    Member since:
    Nov 2011

    Posted 11 Jul 2014 Link to this post

    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?
  2. Yoan
    Admin
    Yoan avatar
    1215 posts

    Posted 16 Jul 2014 Link to this post

    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.
     
Back to Top