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

Question: How do I Set Alignment of Checkbox Column to Center

3 Answers 129 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Jorge Gonzalez
Top achievements
Rank 1
Jorge Gonzalez asked on 28 Jan 2010, 04:37 PM
Hello,
    I have a checkbox column in my grid but it appears left justified. I want to center it but have not found the command or event where to do this.
Any help would be appreciated.
Thanks

3 Answers, 1 is accepted

Sort by
0
Stefan Dobrev
Telerik team
answered on 02 Feb 2010, 11:08 AM
Hi Jorge Gonzalez,

You should set the HorizontalContentAlignment property of the combo via EditorStyle property. Here is a sample code for this:
<telerik:GridViewComboBoxColumn Header="Country" DataMemberBinding="{Binding Country}" ItemsSource="{StaticResource Countries}">
    <telerik:GridViewComboBoxColumn.EditorStyle>
        <Style TargetType="telerik:RadComboBox">
            <Setter Property="HorizontalContentAlignment" Value="Center" />
        </Style>
    </telerik:GridViewComboBoxColumn.EditorStyle>
</telerik:GridViewComboBoxColumn>

All the best,
Stefan Dobrev
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
Steven
Top achievements
Rank 1
answered on 15 Apr 2011, 02:51 PM
Hi,

I am facing the same problem.
I have tried this but it does not work :

<telerik:GridViewCheckBoxColumn.EditorStyle>
                        <Style TargetType="CheckBox">
                            <Setter Property="HorizontalContentAlignment" Value="Center" />
                        </Style>
                    </telerik:GridViewCheckBoxColumn.EditorStyle>

regards,
S
0
Vanya Pavlova
Telerik team
answered on 15 Apr 2011, 03:11 PM
Hi Steven,

 
Please take a look at the following forum thread.

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
Tags
GridView
Asked by
Jorge Gonzalez
Top achievements
Rank 1
Answers by
Stefan Dobrev
Telerik team
Steven
Top achievements
Rank 1
Vanya Pavlova
Telerik team
Share this question
or