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

Object(bool) being displayed as text instead of checkbox

1 Answer 332 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Youssef
Top achievements
Rank 1
Youssef asked on 27 Mar 2018, 10:32 AM

     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.

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 28 Mar 2018, 01:13 PM
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.
Tags
GridView
Asked by
Youssef
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or