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
1240
Styling the HeaderPresenter
posted

I’m trying to style the background color of the Header Presenter.  I’ve styled it as follows:

<Style TargetType="{x:Type igDP:HeaderPresenter}">
 <Setter Property="Template">
  <Setter.Value>
   <ControlTemplate TargetType="{x:Type igDP:HeaderPresenter}" >
    <Grid>
     <Rectangle Fill="Salmon"/>
     <ContentPresenter
          Content="{TemplateBinding Content}"
          ContentTemplate="{TemplateBinding ContentTemplate}"
          VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
     </Grid>
   </ControlTemplate>        
  </Setter.Value>
 </Setter>
</Style>

It works, however, it does not take care of the area of the header that does not have labels as shown in this screen shot:

I put a kludge fix in by making the margin’s of the rectangle so that it would fill this area, but would rather have a more elegant fix. What would you suggest?

Also, I need to change the color of the area between the 2 scroll bars (See Screen Shot).  How can I achieve this?

Finally, is there a document which shows which the names of each area and which styles affect them?  I find it difficult to determine which style I need to change based on some of the names which have been given to them.

Thanks

Dan

 

Parents
No Data
Reply
  • 69686
    posted

    Hello Dan,

    Regarding your first question, this is the HeaderAreaBackground property of the DataRecordPresenter element. You can see the same issue as this here.

    There are some articles about styling with diagrams in our help but I would recommend using Snoop to do the trick.

     

    Regarding the space between the scrollbars, the XamDataGrid uses standard scrollviewer and if you want to change this color, you would have to retemplate it. This area (in the default template) belongs to the root element of the template. One way to resolve this is to set the background of the root element and make the background of the ScrollContentPresenter area something else.

Children