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
515
Column Header using Style
posted

Hi,

I am trying to customize column header using style. I want to put button for filter in the column header. But the the column default style must be maintained as such. So I tried doing in the below mentioned way:

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

<Setter Property="Template">

<Setter.Value>

<ControlTemplate TargetType="{x:Type igDP:LabelPresenter}">

<Grid>

<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>

<Button Width="15" Height="15" x:Name="btnCol" HorizontalAlignment="Left" Click="btnCol_Click" >

</Button>

</Grid>

</ControlTemplate>

</Setter.Value>

</Setter>

</Style>

 but when this style is applied to LabelPresenter i am loosing the default look for Column. I mean I am not able to view "sorting" icon which appears bydefault in the column though sorting functionality is working fine.

Please need help for this.

Thanks,

Sejal

Parents
  • 2320
    posted

     It's because you're creating a whole new template for LabelPresenter which overrides the original. (I'm assuming that the sorting icon is set in LabelPresenter). You will need to add that code into your template for it to work. Infragistics provides all the styles and templates for these things with the installation so you can just copy and paste that part into your code.

Reply Children