Bind to a property of a parent element in wpf

Posted by msfanboy on Stack Overflow See other posts from Stack Overflow or by msfanboy
Published on 2010-03-13T18:59:19Z Indexed on 2010/03/13 19:05 UTC
Read the original article Hit count: 267

Filed under:
|
|
|
|

Hello all,

I want to bind the Height property of the RichTextBox to the Height Property of the GridViews Row. How can I do that? I do not know how to get the Rows Height as I can not access the Row in xaml what I would like to do.

<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>

...

© Stack Overflow or respective owner

Related posts about wpf

Related posts about bind