Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
215
Bind custom Node ItemTemplate to Node's Data object
posted

I have a custom template for a NodeLayout in my DataTree. It has a check box and textblock. I want to bind the checkbox IsChecked property to the Node targetTypes's IsSelected property and the Content property to Node targetType's Description property. Reason for the template, is that the rest of the tree has Checkbox Mode=Auto, but these nodes should be independent.

My XAML:

<ig:XamDataTree.GlobalNodeLayouts>
<ig:NodeLayout Key="ItemLayout" TargetTypeName="clsItem" DisplayMemberPath="Description" IsExpandedMemberPath="IsExpanded" />
<ig:NodeLayout Key="SubItemLayout" TargetTypeName="clsSubItem" DisplayMemberPath="Description">
<ig:NodeLayout.ItemTemplate>
<DataTemplate>
<CheckBox Content="clsSubItem.Description" IsChecked="True" />
</DataTemplate>
</ig:NodeLayout.ItemTemplate>
<ig:NodeLayout.CheckBoxSettings>
<ig:CheckBoxSettingsOverride CheckBoxVisibility="Collapsed"/>
</ig:NodeLayout.CheckBoxSettings>
</ig:NodeLayout>
</ig:XamDataTree.GlobalNodeLayouts>

The SubItemCheckChanged function should have access to the node's data object, i.e. the clsSubItem object. How can I achieve this?

I tried to bind to TemplatedParent and then extract Description and IsSelected property, but then it is not independent of the rest of the tree anymore. If I click parent, this checkbox gets checked.

Chris tried to help me here, but got no response later: http://es.infragistics.com/community/forums/t/107213.aspx

Thanks,

Parents
No Data
Reply Children
No Data