DinaDee
DinaDee

Reputation: 287

radgridview bool columns are coming in as textbox instead of checkbox

All my new rows added to a radgridview from telerik are coming in as textbox instead of checkbox.
Can anyone tell me why or atleast give me code to convert it in c#

Code is like this:

 var qry = Settings.DbContext.OAdbContext.Sp_Temp(id).ToList();
radgridview1.DataSource = qry.ToList();

and in qry, I have a bool property that is showing up False and True instead of checkbox. When I debug, column info shows me GridViewTextBoxColumn

Upvotes: 0

Views: 663

Answers (2)

woodykiddy
woodykiddy

Reputation: 6455

To help us better understand and resolve your issue, it'd be good if you can provide the markup code so that we can see what's been done on the UI.

The Telerik RadGridView control handles it naturally and all you need to do is to make sure the column is bound to the correct data member with the correct data type.

<telerik:RadGridView x:Name="radGridView1" AutoGenerateColumns="False">
   <telerik:RadGridView.Columns>
       <telerik:GridViewCheckBoxColumn DataMemberBinding="{Binding YourBooleanTypeMember}" />
   </telerik:RadGridView.Columns>
</telerik:RadGridView>

Upvotes: 1

KSib
KSib

Reputation: 911

You need to use a CheckBox Column: http://docs.telerik.com/devtools/wpf/controls/radgridview/columns/columntypes/checkbox-column

Or you can use a template: http://docs.telerik.com/devtools/wpf/controls/radgridview/columns/celltemplate-and-celledittemplate

I don't believe the GridView Column will figure out that bool means checkbox automatically.

Upvotes: 0

Related Questions