WPF - simple relative path - FindAncestor

Posted by user309392 on Stack Overflow See other posts from Stack Overflow or by user309392
Published on 2010-04-05T17:47:53Z Indexed on 2010/04/05 17:53 UTC
Read the original article Hit count: 1055

Filed under:
|

In the XAML below the ToolTip correctly binds to RelativeSource Self. However, I can't for the life of me work out how to get the TextBlock in the commented block to refer to SelectedItem.Description

<Controls:RadComboBoxWithCommand x:Name="cmbPacking"
                                 Grid.Row="2"
                                 Grid.Column="5"
                                 ItemsSource="{Binding PackingComboSource}"
                                 DisplayMemberPath="DisplayMember"
                                 SelectedValuePath="SelectedValue"
                                 SelectedValue="{Binding ElementName=dataGrid1, Path=SelectedItem.PackingID}"
                                 ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=SelectedItem.Description}"
                                 IsSynchronizedWithCurrentItem="True"
                                 Style="{StaticResource comboBox}">
 <!--                    <Controls:RadComboBoxWithCommand.ToolTip>-->
                <!--                        <TextBlock Text="{Binding RelativeSource={RelativeSource Self}, Path=SelectedItem.Description}" TextWrapping="Wrap" Width="50"/>-->
 <!--                    </Controls:RadComboBoxWithCommand.ToolTip>-->                   
</Controls:RadComboBoxWithCommand>

I would appreciate any suggestions

Thanks - Jeremy

© Stack Overflow or respective owner

Related posts about wpf-binding

Related posts about wpf