I'm using a 12.1 xamdatagrid with one level of child rows, and I was trying to find an elegant way to set the child row background to the same as its parent's, and the parent rows have alternate row highlighting (the children should all be the same, parent color). Any ideas? Thanks.
Here's the key lines from a value converter (but I'd prefer a xaml solution): var presenter = DataRecordPresenter.FromRecord((value as Record).ParentDataRecord);return presenter.IsAlternate ? new SolidColorBrush(...) : new SolidColorBrush(...);
Hallo Darryl,
I have been investigating your issue. After the investigation I have created a small sample for you, named ColorBackgroundForAlternatingRows. In the sample I set two styles – one for the CellValuePresenter of the Parent record and one for the CellValuePresenter of the child record. To highlight the alternated row I set the HighlightAlternateRecords property for the first layout to True. In order only the children of alternated rows to be highlighted I use the Index property of the Parent record. Please find the attached sample and feel free to let me know if you require any further assistance on the mater.
Thank you. I guess there's no way around a value converter for this problem. Your solution is very well done.
Hello Darryl,
I am glad that my solution was helpful to you. Please do not hesitate to contact us if you have any further questions.
Thank you for using Infragistics controls.