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.
Unfortunately, activation email could not send to your email. Please try again.

Master-DetailView alternate row style

Thread ID:

Created:

Updated:

Platform:

Replies:

121371 Dec 7,2015 09:37 AM Dec 8,2015 10:59 PM WPF 2
loading
Tags: SfDataGrid
James Randle
Asked On December 7, 2015 09:37 AM

Hi,
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!
James.

Attachment: changeBackgroundColour_e2a95706.rar

James Randle
Replied On December 7, 2015 10:22 AM

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>}".

Cheers,
James.

Sowndaiyan Paulpandi [Syncfusion]
Replied On December 8, 2015 10:59 PM

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

Regards,

Sowndaiyan


CONFIRMATION

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.

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.

;