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

[Solved] ComboBoxColumn alignment issue

2 Answers 169 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tomas
Top achievements
Rank 1
Tomas asked on 08 Feb 2011, 12:34 PM
Hi,

I've noticed that the ComboBoxColumn while in display mode aligns the text far more to the right than for example a normal DataColumn does however in edit mode (ComboBox visible) the alignment is ok. This makes the text "jump" from side to side when switching between edit and display mode.

I've included a screenshot for reference but the same behaviour can be seen in your demo aswell:
http://demos.telerik.com/silverlight/#GridView/ComboBoxColumn

How to fix this?

Tomas

2 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 09 Feb 2011, 06:33 PM
Hello Tomas,

You may define a cell style as follows:

<UserControl.Resources>    
    <Style x:Key="ComboBoxCellStyle" TargetType="telerik:GridViewCell">
        <Setter Property="Padding" Value="1,0,0,1" />
    </Style>
</UserControl.Resources>

and set it for the GridViewComboBoxColumn:
<telerik:GridViewComboBoxColumn Header="Nationality"
    CellStyle="{StaticResource ComboBoxCellStyle}"
                  DataMemberBinding="{Binding CountryID}"
                  DisplayMemberPath="Name"
                                SelectedValueMemberPath="ID" />
 

Greetings,
Maya
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Tomas
Top achievements
Rank 1
answered on 25 Feb 2011, 10:55 AM
Hi Maya,

Thank you that works. But shouldn't this be the default?
Is it possible to set this style on all columns of type GridViewComboBoxColumn instead of explicitly having to set the style on all grids?

Tomas
Tags
GridView
Asked by
Tomas
Top achievements
Rank 1
Answers by
Maya
Telerik team
Tomas
Top achievements
Rank 1
Share this question
or