Filter error - Object cannot be cast from DBNull to other types

5 posts, 0 answers
  1. Steve
    Steve avatar
    3 posts
    Member since:
    Jan 2012

    Posted 17 Apr 2012 Link to this post


    I'm trying to filter a RadGridView against a standard Dataset tableadapter with a SQL server DateTime field.

    Some of the field values in the background table column are Null.

    The datatable has the field properties set to "AllowDBNull" values, however the error I am receiving is "Invalid filter expression"

    When viewing the detail exception I am seeing "Object cannot be cast from DBNull to other types".

    The attached image shows the tableadapter field settings and the error dialogs.

    Any ideas on how to work around this error without changing from a dataset.

    Thanks in advance.
  2. Steve
    Steve avatar
    3 posts
    Member since:
    Jan 2012

    Posted 17 Apr 2012 Link to this post

    One more point I just tested out was this was working in the Rad Version 2012.1.12.0215 (file setup: RadControls_WinForms_2012_1_12_0215_trial), but is not working now with the latest trial Version 2012.1.321.40.
  3. Stefan
    Stefan avatar
    2906 posts

    Posted 20 Apr 2012 Link to this post

    Hi Steve,

    Thank you for writing.

    This is a know issue, which is already resolved in our latest internal build. You can download the internal build from Your Account.

    I hope that you find this information useful. Let us know if you have any other questions.

    All the best,
    the Telerik team
    RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
  4. John
    John avatar
    23 posts
    Member since:
    Sep 2013

    Posted 16 Jun 2015 Link to this post

    Hi,  I'm getting this same error when I filter on a Checkbox Column.  Any ideas.  I have version 2014.3.1202.40.




  5. Dess
    Dess avatar
    2164 posts

    Posted 19 Jun 2015 Link to this post

    Hello John,

    Thank you for writing.

    It seems to be a known issue which is already fixed in Q3 2014 SP1 (2014.3.1202). Here is the feedback item for your reference. If you are still reproducing the problem with version 2014.3.1202, could you please provide a sample code snippet replicating the issue? Thus, we would be able to investigate the precise case and assist you further. Thank you in advance.

    I am looking forward to your reply. 

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top