Object(bool) being displayed as text instead of checkbox

2 posts, 0 answers
  1. Youssef
    Youssef avatar
    1 posts
    Member since:
    Oct 2017

    Posted 27 Mar 2018 Link to this post

         Hello, 

    i'm binding an observable collection of expando objects to a radgridview, each object is supposed to contain a boolean but since i'm constructing my expando object from a <string, object> dictionary the bool property is an object(bool), so when these are displayed with autogeneratingcolumns true i just get a text column with true or false 

     

    how can i display them as checkbox ? 

     

    Thanks by advance.

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    4059 posts

    Posted 28 Mar 2018 Link to this post

    Hello, Youssef  

    You can remove the automatically generated column and add a GridViewCheckBoxColumn which FieldName is the respective property in your instance: https://docs.telerik.com/devtools/winforms/gridview/columns/column-types/gridviewcheckboxcolumn

    If the value that is stored in the column doesn't convert to bool it is appropriate to implement a TypeConverter which will be responsible for the conversion between the column type and the DataBoundItem's property type. A sample approach for a custom TypeConverter is demonstrated in the following help article: https://docs.telerik.com/devtools/winforms/gridview/columns/converting-data-types

    I hope this information helps. If you have any additional questions, please let me know. 

    Regards,
    Dess
    Progress Telerik
    Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top