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

GridViewHeaderCell Style is being hijacked

1 Answer 56 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Noam
Top achievements
Rank 1
Noam asked on 16 Nov 2009, 06:35 PM
HI,

1. I have a ResourceDictionary with two Styles for GridViewHeaderCell - one is with x:Key="MyKeyedStyle" and the other has only TargetType definition.
2. The style with the key (MyKeyedStyle) is effectively BasedOn my "default" style and has a different implementation of the "Template" property (adding a border for color coding).
3. The "default" style in defined before the keyed style.
4. In GridViewDataColumn tag, I've added: HeaderCellStyle="{DynamicResource MyKeyedStyle}" (also, tried: HeaderCellStyle="{StaticResource MyKeyedStyle}")

At run-time the keyed style (MyKeyedStyle) is not applied to HeaderCell, only the "default" one is applied.
When I remove the default style everything works as expected, only I get Telerik's default colors.

Please help, how do I make a default style and another keyed one to work together?

(for some reason, I can't attach a zipped solution to this post (changed file type to *.zip.png). It's size is 26KB but I get "Please upload valid files: .gif,.jpg,.jpeg,.png smaller than 2MB." error when posting....)

TIA,-
Noam

1 Answer, 1 is accepted

Sort by
0
Kalin Milanov
Telerik team
answered on 18 Nov 2009, 12:04 PM
Hi Noam,

Attached I am sending you a sample application which achieves the described in your post. Hopefully it will lead you to a solution of your problem.

If not could you please attach a sample or paste the XAML in here so I can investigate this further.

All the best,
Kalin Milanov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
GridView
Asked by
Noam
Top achievements
Rank 1
Answers by
Kalin Milanov
Telerik team
Share this question
or