Hi,
I am working on xamDataTree and facing a problem, I want to set the Checkbox Visibility of the inner Nodes based on a condition (i.e. if the EntityInformation.CheckBoxEnable property is "false" then I dont want to display the checkbox).
But when I am trying to do like
<ig:CheckBoxSettingsOverride CheckBoxVisibility="{Binding Data.EntityInformation.CheckBoxEnable, Converter={StaticResource boolToVisibilityConverter}}"/>
I am getting following error
A 'Binding' cannot be set on the 'CheckBoxVisibility' property of type 'CheckBoxSettingsOverride'. A 'Binding' can only be set on a DependencyProperty of a DependencyObject.
Please help me to acheive the functionality.
Hello,
I have been looking into your issue and I am not completely sure what you need. If you want to have some of the ChecBoxes show and some of them not, binding to the CheckBoxVisibility property won’t work as it sets the visibility for all nodes in the layout. If you have a proeprty in your underlying data objects, I can suggest looking through this forum thread that discusses the same thing: http://ko.infragistics.com/community/forums/t/65140.aspx
Please let me know if you require any further clarification on the matter.
Hi Petar,
First of all, Thanks for your response.
Can you please post a sample project so that I can understand what you were trying to say. I am not sure How can I use XamDataTreeNodeControl.
And yes, I am having a property (of type bool ) in the underlying data object, based on that property only I want to set the Visibility of the check box.
Waiting for your reply....Thanks once again...
I am using MVVM
Hi again,
Here is a small sample project (DataTree_checkBox_Binding.zip), that does what Darrell suggest in the thread I mentioned I my previous reply. I have copied the original template for the XamDataTreeNodeControl, along with its needed resources (brushes, converters, etc…), and have modified the Binding of its inner CheckBox element to:
Visibility="{Binding Node.Data.IsAvailable, Converter={StaticResource BoolToVis}}"
where IsAvailable is a bool property of my underlying MenuItem class.
Please let me know if I can be of any further assistance on the matter.
I tried with the example Everything is working fine with an exception.
Problem is that if "All the child Nodes are not available then I need to make the Parent node Check Box also Invisible"
Like in the snapshot attached, You can see if all the Trucks are not available then I need to Hide the checkBox for "TruckLayout"
Please help me to hide that one also other things are working fine
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
I have modified the sample I sent you before, so now it works as you want. Basically I set the NodeStyle of the ChildLayout, too. Also I can say that the visibility of the CheckBoxes is determined by the IsAvailable property in the ViewModel.
Hope this helps you.
Hi Stoyanov,
Still I am facing the same problem, the parent checkbox is not getting Hide if all the child Node's check box are Hide. And i want to do this using MVVM.
Thanks for your response. and waiting for the solution of this problem.