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

Styling GridViewCheckBoxColumn

6 Answers 206 Views
GridView
This is a migrated thread and some comments may be shown as answers.
John
Top achievements
Rank 1
John asked on 14 Jun 2011, 03:05 PM
Telerik file version: 2010.3.1110.40
Preferred Language C#

I apologize if this has been asked somewhere, but I could not find it.

I have a a GridView with several auto generated check boxes.  I am trying to apply the following style in the resources to enable one click editing:

<Style TargetType="{x:Type telerik:GridViewCheckBoxColumn}">        
       <Setter Property="EditTriggers" Value="CellClick"/>
       <Setter Property="AutoSelectOnEdit" Value="True"/>
</Style>

Aside from the style not applying to the generated checkbox columns, the AutoSelectOnEdit property is is saying “Exception thrown by the target of the invocation”.  

Is there a way to apply these properties to the entire page?

6 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 14 Jun 2011, 03:34 PM
Hello John,

You cannot set a style targeting a column since its is not a visual element. I would suggest you to set the required properties directly to the GridViewCheckBoxColumn. You may try to set the EditTriggers property by creating a style targeting RadGridView. But in this case it will be applied to all columns, no matter if they are GridViewDataColumn, GridViewComboBoxColumn, GridViewCheckBoxColumn, etc.
  

Kind regards,
Maya
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
John
Top achievements
Rank 1
answered on 14 Jun 2011, 04:14 PM
Maya,

Thank you for the quick reply. I am OK with applying the EditTriggers property to the entire grid, unfortunately, the number of columns is variable so I am not sure how to apply the AutoSelectOnEdit. 

Thanks again for your assistance
john
0
Maya
Telerik team
answered on 17 Jun 2011, 08:55 AM
Hello John,

Actually, we have discovered a small issue preventing setting the style required in WPF. It has been immediately resolved and it will be available in our next build. Please excuse us for the inconvenience caused.
 

Best wishes,
Maya
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
May
Top achievements
Rank 1
answered on 12 Jun 2012, 12:20 PM
I have an issue with the style of the GridViewCheckBoxColumn, the checkbox has a style, and it looks as it should. But when I Check og Uncheck the checkbox mye style disappers and I the underlying default style appars. My style comes back when I change the focus to an other element. Is there a GridViewCheckBoxColumn style, and what part of it to I need to address? My Style is set with targettype GridViewCheckBox.
0
Vanya Pavlova
Telerik team
answered on 12 Jun 2012, 12:29 PM
Hi May,

 

The standard GridViewCheckBoxColumn uses a GridViewCheckBox and the standard CheckBox control as its editor. The style targeted at GridViewCheckBox will affect the appearance in view mode, if you want to modify it in edit mode you should define a style targeted at System.Windows.CheckBox. 



Regards,
Vanya Pavlova
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
May
Top achievements
Rank 1
answered on 12 Jun 2012, 12:41 PM
Thank you!
Tags
GridView
Asked by
John
Top achievements
Rank 1
Answers by
Maya
Telerik team
John
Top achievements
Rank 1
May
Top achievements
Rank 1
Vanya Pavlova
Telerik team
Share this question
or