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
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.
Maya
the Telerik team
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
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.
Maya
the Telerik team
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.
Vanya Pavlova
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>