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
180
Modify background color of header
posted

Hi,

How can i modify (programmatically) the header background of a specific column leaving all other headers unchanged?

Thanks,

Ofer

Parents
  • 28407
    posted

    HI ,

     Create a style targeting the LabelPresenter and set the FieldSetting's LabelPresenterStyle to that style.

     Here are the code snippets:

     

    <Grid.Resources>  

               <Style x:Key="lbstyle" TargetType="{x:Type igDP:LabelPresenter}"> 

              <Setter Property="Background" Value="red"/>

                </Style> </Grid.Resources>

     <igDP:XamDataGrid.FieldLayouts>  

                   <igDP:FieldLayout>

                        <igDP:FieldLayout.Fields>

                             <igDP:Field Name="Name">  

                               <igDP:Field.Settings>

                                     <igDP:FieldSettings LabelPresenterStyle="{StaticResource lbstyle}"/>  

                               </igDP:Field.Settings>  

                           </igDP:Field>  

                           <igDP:Field Name="Age"/>   

                      </igDP:FieldLayout.Fields>

                    </igDP:FieldLayout>

     </igDP:XamDataGrid.FieldLayouts>

     Sincerely,

     Matt

     Developer Support Engineer

Reply Children