We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Master-DetailView alternate row style

Thread ID:





121371 Dec 7,2015 02:37 PM UTC Dec 9,2015 03:59 AM UTC WPF 2
Tags: SfDataGrid
James Randle
Asked On December 7, 2015 02:37 PM UTC

How can I style the area around the details SfDataGrid so that its background alternates along with its parent row?
At the moment, all the detail SfDataGrids have the same Background which makes it slight confusing to look at!

I've attached an image to demonstrate.

Thanks again!

Attachment: changeBackgroundColour_e2a95706.rar

James Randle
Replied On December 7, 2015 03:22 PM UTC

I can see that i need to style the DetailsViewRowControl, but looking at the visual tree, it seems that the VirtualizingCellsControl (the row) and the DetailsViewRowControl (the area surrounding the detail SfDataGrid) both belong to the same parent and there is no property to connect a particular DetailsViewRowControl to the corresponding VirtualizingCellsControl .

If I can get a reference to the corresponding VirtualizingCellsControl from a particular DetailsViewRowControl then I can bind to that row's style DetailsViewRowControl.Background="{Binding Path=Background, Element=<Corresponding VirtualizingCellsControl>}".


Sowndaiyan Paulpandi [Syncfusion]
Replied On December 9, 2015 03:59 AM UTC

Hi James,

Thank you for contacting Syncfusion Support.

We have analyzed your query. In SfDataGrid if you set “DetailsViewRowControl Background color, then it is not possible to change its background color for each DetailsViewDataGrid at runtime. However you can set the Set the Background color for current selected DetailViewDataGrid by customize style of DetailsViewRowControl and DetailsViewDataGrid. We have prepared a sample for set current selected DetailViewDataGrid background color and you can download the sample from the below location. In this sample we have set the Background color using converter and SfDataGrid.SelectionChanged event.

Sample : http://www.syncfusion.com/downloads/support/forum/121371/ze/MasterDetailsView_WPF-418660119-881815365




This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon