Hello all, 'I want to bind the Height property of the RichTextBox to the Height Property of the GridView`s Row. How can I do that? I do not know how to get the Row's Height as I can not access the Row in xaml what I would like to do.
The Ancestor type should be GridViewHeaderRow , but I do not know its level...
EDIT:
<my:RadGridView Height="524" RowHeight="300" ItemsSource="{Binding Lessons}" AutoGenerateColumns="False" Name="dataGrid1" VerticalAlignment="Top" SelectionMode="Single" CanUserSortColumns="False" IsFilteringAllowed="False">
<my:RadGridView.Columns>
<my:GridViewDataColumn DataMemberBinding="{Binding SchoolclassName}" Header="Schoolclass" Width="0.1*" />
<my:GridViewDataColumn DataMemberBinding="{Binding SubjectName}" Header="Subject" Width="0.1*" />
<my:GridViewDataColumn Width="0.3*" Header="Homework">
<my:GridViewDataColumn.CellTemplate>
<DataTemplate>
<RichTextBox Height="{Binding ElementName=dataGrid1,Path=RowHeight}" >
<FlowDocument>
<Paragraph>
<Run Text="{Binding Homework}"/>
</Paragraph>
</FlowDocument>
</RichTextBox>
</DataTemplate>
</my:GridViewDataColumn.CellTemplate>
<my:RadGridView Height="524" ItemsSource="{Binding Lessons}" AutoGenerateColumns="False" Name="dataGrid1" VerticalAlignment="Top" SelectionMode="Single" CanUserSortColumns="False" IsFilteringAllowed="False">
<my:RadGridView.Columns>
<my:GridViewDataColumn Name="ContentColumn" Width="0.3*" Header="Content">
<my:GridViewDataColumn.CellTemplate>
<DataTemplate>
<RichTextBox Height="{Binding ElementName=MyRowNameToBindTo,Path=Height}">
<FlowDocument>
<Paragraph>
<Run Text="{Binding Content}"/>
</Paragraph>
</FlowDocument>
</RichTextBox>
</DataTemplate>
</my:GridViewDataColumn.CellTemplate>
...