13 Answers, 1 is accepted
I have attached is a sample project, in which the TextAlignment property of GridViewDataColumn works correctly with Office2013 theme. Can you please take a look at it and let me know if I am missing something?
Regards,
Stefan
Telerik
Stefan,
I will take a more in depth look after my holidays.
What I'm currently is that it was working with Q1 2015 SP1 and that it doesn't work with Q2 2015.
My scenario is much more complicated that just a single grid view in a window: the main window is a RibbonWindow, with a Ribbon and a Docking. Inside one of the panes (created dynamically, when the user clicks on a command in the ribbon), I have a TabControl, each tab containing a grid view and some other controls. The TabItem are created dynamically, because the ones to display depends on the data.
So I need to simplify the application just to look where the problem is.
The demo application I attached was tested with Q2 2015 version.
If you manage to isolate the issue in a sample project, you can send it to us as an attachment in a new support thread, so we can debug it on our side. You can take a look at the Isolating a problem in a sample project blog post for more information.
Best Regards,
Stefan
Telerik
If the value of the TextAlignment set using style setter, the text in the cell grid view is not aligned.
Sample:
<Style x:Key="NameColumnStyle" TargetType="telerik:GridViewDataColumn">
<Setter Property="TextAlignment" Value="Right"/>
</Style>
<telerik:GridViewDataColumn DataMemberBinding="{Binding Name}" Style="{StaticResource NameColumnStyle}"/>
Thank you for your feedback.
I investigated the problem and it seems that it is an issue on our side. I have logged it in our bug tracking system. You can check its progress in our Feedback Portal: TextAlignment not respected when applied through Style for GridViewDataColumn.
Best Regards,
Stefan
Telerik
3 months later and two new versions: the problem is still here...
As of Q2 2015 the following issue has been fixed: TextTrimming, TextAlignment and TextWrapping properties set through an implicit style targeting TextBlock is not applied on scrolling.
So, a possible approach for this case would be to update your binaries version and try applying a Style targeting TextBlock. I hope this fits your requirements.
Best Regards,
Stefan
Telerik
Stefan,
as stated on my first post, the problem started showing at the Q2 2015 version. I'm currently using Q3 2015 and the problem is still here.
One of the column, for example, is defined as:
<
tk:GridViewDataColumn
DataMemberBinding
=
"{Binding NoPlayer1}"
HeaderTextAlignment
=
"Right"
IsFilterable
=
"False"
IsGroupable
=
"False"
TextAlignment
=
"Right"
UniqueName
=
"NoPlayer1"
Width
=
"50"
/>
And the column content is left aligned!
So the problem is not related to a style.
If you want, I can send, in a private message, an URL where you can download the application to take a look.
If you do not need to use an implicit style, but set the TextAlignment property directly it should be applied. I am attaching a sample application as a demonstration. I have tested it with 2015.2.623 version.
Can you please check it out and let me know in case I am missing something?
Regards,
Stefan X1
Telerik
Stefan,
I know that, in simple cases, the alignment is working.
My case is much more complicated, because the application contains a Docking, one pane contains a TabControl and a tab contains the GridView. In addition, the GridView is defined as a custom control (to be reusable).
That's why I can provide you with the application and the source if needed.
I can't want to make it public, but I can give you the information in a private message, if possible.
Note also that the application was working fine until version Q2 2015 is out and you correct something on it...
It will be great if you can provide your sample project which demonstrates the issue. Please open new support ticket and attach it there. I will debug it on my side and I will assist you further.
Regards,
Yoan
Telerik
Yoan,
I've posted a support ticket with a link to the application and its source code.
Waiting to have news about this problem.
I will update the other thread once I have more information about the problem.
Regards,
Yoan
Telerik