9 Answers, 1 is accepted
0
Hello Chris,
Vanya Pavlova
the Telerik team
You can center the checkboxes in GridViewCheckBoxColumn through defining a simple style, use the following markup:
<
Style
TargetType
=
"telerik:GridViewCheckBox"
>
<
Setter
Property
=
"HorizontalAlignment"
Value
=
"Center"
/>
</
Style
>
All the best,
Vanya Pavlova
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
Ariel
Top achievements
Rank 1
answered on 14 Oct 2010, 06:21 PM
Hi Vanya
I had the same question. Your solution solved the problem partially. What about if I want the Checkbox to be centered also while editing. How can I achieve that.
Thanks,
Bhavik
I had the same question. Your solution solved the problem partially. What about if I want the Checkbox to be centered also while editing. How can I achieve that.
Thanks,
Bhavik
0
david mcintyre
Top achievements
Rank 1
answered on 15 Oct 2010, 07:03 PM
i was able to center the checkbox when it's in editmode by creating a new default style w/ target type = GridViewEditorPresenter. But could only get it to work by setting it as a nameless default style. i can't figure out what column style property to apply it to.
0
Hello Bhavik,
In order to be able to center the GridViewCheckBox through editing you should create style that is targeted at GridViewCell and set its HorizontalContentAlignment property to Center and apply that style to the GridViewCheckBoxColumn.
Please check the attached project that illustrates this approach.
Kind regards,
Vanya Pavlova
the Telerik team
In order to be able to center the GridViewCheckBox through editing you should create style that is targeted at GridViewCell and set its HorizontalContentAlignment property to Center and apply that style to the GridViewCheckBoxColumn.
Please check the attached project that illustrates this approach.
Kind regards,
Vanya Pavlova
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
Ariel
Top achievements
Rank 1
answered on 19 Oct 2010, 02:10 PM
Hi Vanya
That works perfect.
Thanks
Bhavik
That works perfect.
Thanks
Bhavik
0
Kjetil
Top achievements
Rank 1
answered on 17 Aug 2011, 10:15 AM
Hi,
I tried to apply the same solution in a WPF gridview, but as you can see from the attached image the result wasn't all that great... The image shows two checkboxes - one with the style applied and one without. The code can bee seen above the designer.
sincerely,
Kjetil Klaussen
I tried to apply the same solution in a WPF gridview, but as you can see from the attached image the result wasn't all that great... The image shows two checkboxes - one with the style applied and one without. The code can bee seen above the designer.
sincerely,
Kjetil Klaussen
0
Hello Kjetil,
Vanya Pavlova
the Telerik team
As suggested in my previous reply you should use HorizontalContentAlignment instead.
Vanya Pavlova
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
0
Kjetil
Top achievements
Rank 1
answered on 17 Aug 2011, 01:44 PM
Ah, my bad! HorizontalContentAlignment worked a lot better, yes. Thanks!
0
Jim
Top achievements
Rank 1
answered on 16 Feb 2012, 10:31 PM
Can you tell me how this can be done programatically? I need to be able to dynamically add columns with checkboxes in the grid and need them centered. Do you have a C# example?