TreeListBox binding event fails in version 22.1.1

Grids for WPF Forum

Posted 2 years ago by Sunshine - Appeon
Version: 22.1.1
Avatar

After I upgraded the version to 22.1.1, I found that the commands bound to TreeListBox were invalid. They worked fine before the upgrade.

I have seen relevant changes in the update log, but I have not seen the cases mentioned in the log updated in the Demo program

  • Added the TreeListBoxItemAdapter.GetDefaultActionCommand method and updated the sample TreeNodeModel to properly support default action commands.
<ag:TreeListBox.ItemContainerStyle>
                <Style TargetType="ag:TreeListBoxItem">
                    <Setter Property="DefaultActionCommand" Value="{Binding DataContext.DbClickCommand, RelativeSource={RelativeSource AncestorType=local:SolutionView}}"/>
                </Style>
</ag:TreeListBox.ItemContainerStyle>

Comments (1)

Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

That particular change was made in v22.1.1 because prior to that, we had a TreeNodeModel.DefaultActionCommand property but it never ended up being wired up to push through to the TreeListBoxItem.DefaultActionCommand like various other TreeNodeModel properties were.  It was an oversight that was corrected, and the TreeListBoxItem.DefaultActionCommand property now is populated indirectly via a call to the itemAdapter.GetDefaultActionCommand method, whose implementation hits the TreeNodeModel.DefaultActionCommand property. 

The core places to update on your end would be to remove that Style and implement your itemAdapter.GetDefaultActionCommand method similar to the one in our DefaultTreeListBoxItemAdapter sample.  You can change the GetDefaultActionCommand logic if you need to get your command a different way, but that's the main access point to obtain it.


Actipro Software Support

The latest build of this product (v24.1.2) was released 3 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.