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 Alex, playing with the margins and padding got me there.
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
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.....
Ok, I found it in the DataPresenterGeneric_express file. I'll study it and see if I can make it work.
Thanks.
I've also gone through the API for 'LabelPresenter' hoping to find a property I could target, but nothing that I can identify as the element(s) seperating the Header Labels.