Hi all,
I created a 2-level hierarchical xamDataGrid. So there are 2 headers. But I would like to use different HeaderAreaBackground to distinguish different levels of data..... Anyone can help me? The wpf structure and style make me confused.
Thanks a lot,
Sam
Hello samuicheng,
Thank you for your post. I have been looking through it and I suggest you create two different styles for the LabelPresenter and set them for the different layouts of your xamDataGrid.
You can do something like this:
If you have any further questions on this matter do not hesitate to ask.
Hi Stefan,
Thanks for your quick response and suggestion. My header labels got background color changed successfully. But my ultimate goal is to change the header area background color for different level of data. Becoz the look and feel would be better.
If you find any solution, pls advise. Again, thanks for yr support.
Sincerely,
Hi Sam,
I am glad you achieve part of your goal. To do so with the rest I suggest you add the following code in your FieldLayout.
<igDP:FieldLayout.Settings> <igDP:FieldLayoutSettings> <igDP:FieldLayoutSettings.DataRecordPresenterStyle> <Style TargetType="{x:Type igDP:DataRecordPresenter}" > <Setter Property="HeaderAreaBackground" Value="Green" /> </Style> </igDP:FieldLayoutSettings.DataRecordPresenterStyle> </igDP:FieldLayoutSettings> </igDP:FieldLayout.Settings>
By doing this you will set the HeaderAreaBackground Property of your DataRecordPresenter, which I suppose is your ultimate goal. Here is a screenshot with the result:
I am looking forward to see hearing from you.
It works. Thanks a lot.
have a nice day