Home Forums WPF controls Xceed DataGrid for WPF Setting FixedHeaders in a Style with 2.0

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #26275 |

    Hello,

    I have just switched my application to use the new version of the DataGrid (2.0) and have noticed that the Fixed Headers stuff works a bit differently than it used to. In the past I would use something like the snippet below to set the style for each datagrid in my application:

    <XceedDataGrid:DataGridControl.View>
    <XceedDataGridViews:TableView>
    <XceedDataGridViews:TableView.FixedHeaders>
    <XceedDataGridMarkup:ClearHeadersFooters />
    <DataTemplate>
    <XceedDataGrid:ColumnManagerRow />
    </DataTemplate>
    </XceedDataGridViews:TableView.FixedHeaders>
    </XceedDataGridViews:TableView>
    </XceedDataGrid:DataGridControl.View>

    However, I would like to set this in a style at the application level using something like:

    <Style x:Key=”{x:Type XceedDataGridViews:TableView}” TargetType=”{x:Type XceedDataGridViews:TableView}”>
    <Setter Property=”UseDefaultHeadersFooters” Value=”True” />
    <Setter Property=”ShowRowSelectorPane” Value=”False” />
    <Setter Property=”FixedHeaders”>
    <Setter.Value>
    <DataTemplate>
    <XceedDataGrid:ColumnManagerRow AllowSort=”True”
    AllowColumnReorder=”True”/>
    </DataTemplate>
    </Setter.Value>
    </Setter>
    <Setter Property=”Theme” >
    <Setter.Value>
    <XceedDataGridViews:AeroNormalColorTheme />
    </Setter.Value>
    </Setter>
    </Style>

    This causes the compiler error:

    The Property Setter ‘FixedHeaders’ cannot be set because it does not have an accessible set accessor.

    Is this supposed to be supported? Is there a way for me to globally turn on/off grouping controls and column managers?

    Thanks,
    Ryan

    Imported from legacy forums. Posted by Baldy (had 3053 views)

    Xceed Support
    Member
    Post count: 5658

    Hi Ryan,

    It is not possible to set the FixedHeaders collection via a style. That said, if you want to update your code to v2.0, it would look like the following:

    <xcdg:DataGridControl.View>
    <xcdg:TableView UseDefaultHeadersFooters=”False”>
    <xcdg:TableView.FixedHeaders>
    <DataTemplate>
    <xcdg:ColumnManagerRow/>
    </DataTemplate>
    </xcdg:TableView.FixedHeaders>
    </xcdg:TableView>
    </xcdg:DataGridControl.View>

    Imported from legacy forums. Posted by Jenny [Xceed] (had 3169 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.