Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
175
Styling column headers
posted

Again, I've spent way too long trying to figure this out.  Using XamDataPresenter with a grid view:

 

1. How do I style the area behind the column labels?  Inside the DataRecordPresenter for the column header row, there's a card panel containing a grid containing an expansion indicator, the PART_HeaderContentSite and PART_RecordContentSite content presenters, and a card panel named SpacerFill.  It is this SpacerFill object I need to style; essentially I want to make it transparent so that this background does not show up behind labels.

2. I want to modify the horizontal alignment of the labels themselves. I've been partially successful by modifying the style for LabelPresenter and setting its HorizontalAlignment to Center (setting HorizontalContentAlignment has no effect). However, this messes with the label width, and the result is that the label and its background do not span the entire width of the column.  How do I just simply set the horizontal alignment of the column labels? 

Parents
No Data
Reply
  • 4850
    Offline posted

    1. Here is a way you can make that background transparent:

    <Style TargetType="{x:Type igDP:DataRecordPresenter}">

    <Setter Property="HeaderAreaBackground" Value="Transparent"/>

    </Style>

    2. Actually, there is a property exposed off FieldSettings that is intended for placing cells relative to labels when you aren't using a separate header area but it also affects the horizontal alignment of the text in the labels. Try setting FieldSettings.CellContentAlignment to something like 'LabelAboveValueAlignRight'. 

    I hope tthis helps.

Children
No Data