Note that there are some explanatory texts on larger screens.

plurals
  1. POTreeView two way binding failing at lower levels
    primarykey
    data
    text
    <p>Ok I have a custom TreeListView that inherits from TreeView and has some columns.</p> <p>I have custom objects in my application with two text properties; KeyValue and Description. I'm trying to bind textboxes in the columns to these properties which works great on the initial load, however not so good when I want to change them. It works exactly as it's supposed to (changing the values on the base objects) for top level items, but for anything below that, it doesn't change the underlying values when I change the textbox value. I'm pretty new to WPF so sorry if this is basic but I have searched quite a while and can't find an answer that seems to work for me.</p> <p>The XAML for the TreeListView is:</p> <pre><code>&lt;r:TreeListView Name="TLV_Main" Margin="0,0,0,41" ItemsSource="{Binding Keynotes}" Style="{StaticResource TLV_Standard}"&gt; &lt;r:TreeListView.Columns&gt; &lt;GridViewColumn Header="Key" &gt; &lt;GridViewColumn.CellTemplate&gt; &lt;DataTemplate&gt; &lt;TextBox Text="{Binding Path=KeyValue, Mode=TwoWay}" ContextMenu="{StaticResource Ctx_All}" &gt;&lt;/TextBox&gt; &lt;/DataTemplate&gt; &lt;/GridViewColumn.CellTemplate&gt; &lt;/GridViewColumn&gt; &lt;GridViewColumn Header="Description" Width="{Binding ElementName=TLV_Main, Path=ActualWidth, Converter={StaticResource DescriptionColumnConverter}}"&gt; &lt;GridViewColumn.CellTemplate&gt; &lt;DataTemplate&gt; &lt;TextBox Text="{Binding Path=Description, Mode=TwoWay}" TextWrapping="Wrap"&gt;&lt;/TextBox&gt; &lt;/DataTemplate&gt; &lt;/GridViewColumn.CellTemplate&gt; &lt;/GridViewColumn&gt; &lt;GridViewColumn Width="30"&gt; &lt;GridViewColumn.Header&gt; &lt;Image Source="pack://application:,,,/Resources/Icon_Comment.png" SnapsToDevicePixels="False" Stretch="None"&gt;&lt;/Image&gt; &lt;/GridViewColumn.Header&gt; &lt;GridViewColumn.CellTemplate&gt; &lt;DataTemplate&gt; &lt;Image Source="pack://application:,,,/Resources/Icon_Comment.png" SnapsToDevicePixels="False" Stretch="None" Visibility="{Binding Converter={StaticResource BoolToVisibility}, Path=HasActiveComments}" MouseLeftButtonUp="CommentClick"&gt;&lt;/Image&gt; &lt;/DataTemplate&gt; &lt;/GridViewColumn.CellTemplate&gt; &lt;/GridViewColumn&gt; &lt;GridViewColumn Width="30"&gt; &lt;GridViewColumn.Header&gt; &lt;Image Source="pack://application:,,,/Resources/Icon_Link.png" SnapsToDevicePixels="False" Stretch="None"&gt;&lt;/Image&gt; &lt;/GridViewColumn.Header&gt; &lt;GridViewColumn.CellTemplate&gt; &lt;DataTemplate&gt; &lt;Image Source="pack://application:,,,/Resources/Icon_Link.png" SnapsToDevicePixels="False" Stretch="None" Visibility="{Binding Converter={StaticResource BoolToVisibility}, Path=HasLinks}" MouseLeftButtonUp="LinkClick"&gt;&lt;/Image&gt; &lt;/DataTemplate&gt; &lt;/GridViewColumn.CellTemplate&gt; &lt;/GridViewColumn&gt; &lt;/r:TreeListView.Columns&gt; &lt;r:TreeListView.ItemTemplate&gt; &lt;HierarchicalDataTemplate ItemsSource="{Binding ChildNotes}"&gt; &lt;/HierarchicalDataTemplate&gt; &lt;/r:TreeListView.ItemTemplate&gt; &lt;/r:TreeListView&gt; </code></pre> <p>Can anyone see why this wouldn't work right?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload