Auto-RowHeight in wpf.DataGrid
Asked Answered
L

1

8

I had binded DataGrid to my collection, and i need bind height of each row to my property.

Is it possible? Or is there another way, to link height of each row with corresponding property in the collection ?

Lumberman answered 30/6, 2012 at 11:43 Comment(0)
S
16

You can bind Height in the RowStyle.

Assuming you have a property called RowHeight

<DataGrid ItemsSource="{Binding ...}">
    <DataGrid.RowStyle>
        <Style TargetType="DataGridRow">
            <Setter Property="Height" Value="{Binding RowHeight}"/>
        </Style>
    </DataGrid.RowStyle>
</DataGrid>
Selfopinionated answered 30/6, 2012 at 11:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.