This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, have been loving the product. Can someone provide a quick example of how to style rows on a Grouped Grid? See screenshot. I simply want to set the background color to blue and yellow, yet have not seen how to apply these styles once the Grid has been grouped. Thanks in advance! |
|
|
Hello Great to hear you're enjoying our WPF DataGrid. To customize the look of the grouping rows, paste this code into one of your resource dictionaries:
This is the style we use in OfficeSilver. You can find this and all other DataGrid styles in the Themes folder if you want to customize other parts. With the above style, you can modify this however you like for your application. All resources such as converters mentioned in the above code can be found in the OfficeSilver.DataGrid.xaml file in the Themes folder. Let me know if you need any help with using this style or making modifications. -Jason Fauchelle |
|
|
Thanks for the quick reply Jason. I put this style into it's own xaml resource dictionary and change the color to Red so I could see any change.
In My View, I added this dictionary to my usercontrol as a merged dictionary (like I do my other styles):
Finally, here is my DataGrid definition:
Problem is, the DataGrid grouped rows continue to display with the silver background. I know this is a simple XAML issue, but any idea what I'm missing? |
|
|
Hello Try removing x:Name="DGGroupingRow" from the grouping row style. With only the TargetType set, the style should automatically be applied to grouping row control instances. Let me know how it goes. -Jason Fauchelle |
|
|
Tried that, not it. Simplified things by using the TestGrid app and I still can't get the new style to stick. Take a quick look. Attached. Using the 2/9/2014 nightly. |
|
|
Hello Thanks for sending the sample project. There are 2 options you have to fix this: 1/ Change the way you merge the dictionary to something like this:
2/ Or, create a new class called DataGridGroupedRowStyle.xaml.cs, and call InitializeComponent in its constructor. Hope this helps! -Jason Fauchelle |
|