Skip to content

Any elegant way to override the style of Control, specifically, the DataGridRow? #1243

@oloopy

Description

@oloopy

I tried to hide some of the rows in the DataGrid through DataBinding by changing the RowStyle.

<DataGrid.RowStyle>
    <Style TargetType="DataGridRow">
        <Setter Property="Visibility" Value="{Binding Path=Visibility}"/>
    </Style>
</DataGrid.RowStyle>

While adding the code above into routine would prevent other predefined RowStyle developed by Mahapps work correctly.

What I do now is to copy all the code related to the DataGridRow from Controls.DataGrid.xaml and add them with the above code together into my routine. This time works.

I would like to know if there is an elegant way to change the style without copying&pasting a bunch of code from the source code.

Thanks!

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions