Filter Error when CheckBox column has Null values

4 posts, 0 answers
  1. Steve Hogg
    Steve Hogg avatar
    3 posts
    Member since:
    Jun 2010

    Posted 01 Dec 2014 Link to this post

    I just upgraded to Telerik UI for WinForms 2014 from 2010.

    I have an application with about 40 grids we build dynamically that have checkbox columns. Many of the tables feeding these grids have NULL values for the bit column. When applying a filter to a grid that has NULL values in the CheckBox column I get an error. If I modify my query using ISNULL(fieldname, 0) AS fieldname I am able to filter, but I can no longer update the bit field for that CheckBox column because it is now aliased.

    Before the upgrade the filtering worked even if there were NULL values. What can I do to get both filtering and update capability on CheckBox columns that reference a bit column that contains NULL values. The underlying data cannot be changed to eliminate NULL values because a NULL represents a state other than true or false when handling data in our stored procedures.

    This is the code used to create the CheckBox columns:

    ElseIf objTab.Columns(i).DataType.Name = "Boolean" Then
    Dim col As GridViewCheckBoxColumn = New GridViewCheckBoxColumn
    col.Name = colname
    col.FieldName = colname
    col.HeaderText = colname
    col.ReadOnly = Not (pCanWrite)
    objGrd.Columns.Add(col)
  2. Steve Hogg
    Steve Hogg avatar
    3 posts
    Member since:
    Jun 2010

    Posted 04 Dec 2014 in reply to Steve Hogg Link to this post

    Issue was resolve with 2014 Q3 SP1.
  3. Steve Hogg
    Steve Hogg avatar
    3 posts
    Member since:
    Jun 2010

    Posted 04 Dec 2014 in reply to Steve Hogg Link to this post

    Issue resolve with Q3 service pack 1
  4. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3204 posts

    Posted 04 Dec 2014 Link to this post

    Hello Steve,

    Thank you for writing.

    Your question has already been answered in the support thread that you have opened on the same topic. However, I am posting the answer here as well so the community can benefit from it.

    I confirm that it is a known issue when filtering the RadGridView and GridViewCheckBoxColumn exists with DBNull.Value. Here is the feedback item for your reference. As you have already found out, the fix is introduced in Q3 2014 SP1.

    Currently, due to the specificity of the issue, the possible solution that we can suggest for the specific version is to initialize default value (true/false) for the cells belonging to GridViewCheckBoxColumn if it is DBNull. Another approach is to create a DataTable filled with the specific data where the check box column will be typeof(ToggleState). Thus, for all DBNull values you can use ToggleState.Indeterminate.

    I hope this information helps. Should you have further questions, I would be glad to help.

    Regards,
    Desislava
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
Back to Top