3 Answers, 1 is accepted
0
Accepted
Hello Lee Weisenberger,
Best wishes,
Milan
the Telerik team
Setting HorizontalContentAlignment instead of HorizontalAlignment will resolve the problem.
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Name}"
>
<
telerik:GridViewDataColumn.CellStyle
>
<
Style
TargetType
=
"telerik:GridViewCell"
>
<
Setter
Property
=
"HorizontalContentAlignment"
Value
=
"Right"
/>
</
Style
>
</
telerik:GridViewDataColumn.CellStyle
>
</
telerik:GridViewDataColumn
>
Best wishes,
Milan
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
Vic
Top achievements
Rank 1
Iron
answered on 09 Sep 2014, 07:42 PM
When specifying a CellStyle as suggested above (using Build 2014.2.0617), I find that it also affects the placement of the editor control (RadComboBox) so that it no longer stretches to fit the width of the cell. Specifying an EditorStyle or CellEditTemplate to override this behavior has no effect. Is there another solution?
I am trying to avoid creating a CellTemplate for this column as it complicates the databinding.
Thanks..
I am trying to avoid creating a CellTemplate for this column as it complicates the databinding.
Thanks..
0
Hi,
I would suggest you to use a regular GridViewDataColumn and place a RadCombobox in its CellEditTemplate. Then you can set the TextAlignment property of the column to "Right":
Please give it a try and let me know how it works for you.
Regards,
Yoan
Telerik
I would suggest you to use a regular GridViewDataColumn and place a RadCombobox in its CellEditTemplate. Then you can set the TextAlignment property of the column to "Right":
<
telerik:GridViewDataColumn
DataMemberBinding
=
"{Binding Name}"
UniqueName
=
"Name"
TextAlignment
=
"Right"
>
<
telerik:GridViewDataColumn.CellEditTemplate
>
<
DataTemplate
>
<
telerik:RadComboBox
ItemsSource
=
"{Binding Clubs,Source={StaticResource MyViewModel}}"
HorizontalContentAlignment
=
"Stretch"
SelectedIndex
=
"0"
SelectedValuePath
=
"Name"
/>
</
DataTemplate
>
</
telerik:GridViewDataColumn.CellEditTemplate
>
</
telerik:GridViewDataColumn
>
Please give it a try and let me know how it works for you.
Regards,
Yoan
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.