Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Auto-RowHeight in wpf.DataGrid

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 ?

like image 273
tmt Avatar asked Jun 30 '12 11:06

tmt


1 Answers

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>
like image 105
Fredrik Hedblad Avatar answered Oct 15 '22 11:10

Fredrik Hedblad