How do we bind the xamWebTree checkbox to a bool field in the data source?
For example, assuming the xamWebTree is bounded to
to a Categories collection with nested Products data. How can we get the checkbox values for the corresponding categories and products? Is there a way to bind the checkbox to a bool property in Category and Product?
What we are trying to do is ?
When the checkbox is selected on UI, we want to perform certain action on server and client. So how can we read the checkbox?
Thanks,
I actually got really weird behavior when I followed your example. It looked like one text box item was nested within another. The following worked for me ... Thanks for your help!
<igTree:XamWebTree x:Name="MyTree" CheckBoxVisibility="Visible" CheckBoxMode="Auto" ItemsSource="ParentData">
<igTree:XamWebTree.DefaultItemsContainer>
<DataTemplate>
<igTree:XamWebTreeItem IsChecked="{Binding MyParentProperty, Mode=TwoWay}"/>
</DataTemplate>
</igTree:XamWebTree.DefaultItemsContainer>
<igTree:XamWebTree.HierarchicalItemTemplate>
<ig:HierarchicalDataTemplate ItemsSource="{Binding ChildData}">
<TextBlock Text="{Binding ChildDescription}" />
<ig:HierarchicalDataTemplate.DefaultItemsContainer>
<igTree:XamWebTreeItem IsChecked="{Binding MyChildProperty, Mode=TwoWay}" />
</ig:HierarchicalDataTemplate.DefaultItemsContainer>
<ig:HierarchicalDataTemplate.ItemTemplate>
<TextBlock Text="{Binding ParentDescription}" />
</ig:HierarchicalDataTemplate.ItemTemplate>
</ig:HierarchicalDataTemplate>
</igTree:XamWebTree.HierarchicalItemTemplate>
</igTree:XamWebTree>
No, I spoke too soon. I saw it after applying SR2. It works like a charm.
Thanks!!!
Hi,
Do you have the latest SR? As it was made a DP after the release.
http://es.infragistics.com/dotnet/netadvantage/silverlight/line-of-business.aspx#Downloads
And to use the property, all you need to do, is put an instance of a XamWebTreeItem in your ItemTemplate and set a binding on the IsChecked property.
<DataTemplate><ig:XamWebTreeItem IsChecked="{Binding MyProp, Mode=TwoWay}" ><TextBlock Text="{Binding DisplayProp}"/></ig:XamWebTreeItem></DataTemplate>
-SteveZ
I don't see an IsCheckedProperty dependency property on XamWebTreeItem, so I'm assuming it wasn't fixed in 9.2 like Steve Z said.
Have you received a response?