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

Setting styles for RadGridViewRow using DataTemplate

1 Answer 162 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Swapnil
Top achievements
Rank 1
Swapnil asked on 23 Nov 2017, 09:12 AM

Hi Team,

I would like to set few styles, namely TextDecorations like StrikeThrough, Underline and other styles like Horizontal Alignment, Boldness and Font Style programmatically by creating a FrameworkElementFactory of type Textblock and then assigning the same to a DataTemplate of type GridViewRow, which is then assigned to the ContentTemplateProperty of the GridViewRow; but to no avail.

Could you please guide me on the same.

Please let me know if any details/clarifications are required.

Thanks,

Swapnil Ramteke

1 Answer, 1 is accepted

Sort by
0
Vladimir Stoyanov
Telerik team
answered on 27 Nov 2017, 05:33 PM
Hi Swapnil,

You can set the styles you want on the GridViewCell element rather than on the GridViewRow element, because some of the properties' setters won't be respected if you set them on the GridViewRow (for example the TextDecoration which is not inherited).

I am attaching a sample project where I have set the TextDecoration property through a FrameworkElementFactory to the each of the columns' CellTemplates as suggested in this forum thread. Can you take a look at it and let me know how it fits your scenario?

I am looking forward to your reply.

Regards,
Vladimir Stoyanov
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
GridView
Asked by
Swapnil
Top achievements
Rank 1
Answers by
Vladimir Stoyanov
Telerik team
Share this question
or