I am trying to style the header area in my DataGrid and I can't target the element separating the Header Labels (see attached pics).
Can anyone tell me which element to target?
I used snoop to study the visual tree, and it looks like I need to target child Elements of the labelCntr (CardPanel) element. Most of which are named objects. i.e.
backgroundParent (Grid)
outerBackground (Border)
background (Border)
footerMid (Border)
rightBorder (Rectangle)
... etc.
Can anyone explain how these are exposed? How I access them for styling?
They are part of the LabelPresenter element. You can find its default style in the DefaultStyles directory in the Infragistics folder.
Thanks for your response. I actually started by going through the default style (in my case Office2k7Silver) before I tried snoop. I didn't find any references to the LabelPresenter and after you posted your message, I used the search tool to look for it and found nothing.
The LabelPresenters should be in be in the _Express.xaml files, because they are shared between the full version and the express version of our controls.
Ok, it looks like all the elements I'm interested in (ie rightBorder, footerMid, etc) are all bound to just a few properties - BorderBrush, InnerBorderBush, OuterBorderBrush...
Is this correct? I've already played with these, setting them to bright red, and I still get the big white gaps between my header labels.....
Hello,
The gap could be caused by margings/paddings nside the control telplate. For example on the main Grid:
<Grid x:Name="labelCntr" Margin="2,4,2,4" Background="#00000000">
Another thing you could do is set the background of the header record to the same color as the label presenters so that the gap will have the same color. You can do that with a style for the DataRecordPresenter and creating a trigger for the RecordType propery
Thanks Alex, playing with the margins and padding got me there.