Domanda

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 ?

È stato utile?

Soluzione

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>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top