Hi,
I need to find the checkbox control depending upon XamWebTreeItem in a XamWebTree. So that i want to disable some of the checkboxes on click of a button. Can some body let me know regarding this. Thanks in Advance.
Regards,
Amarendra.
Hello Amarendra,
This issue should be fixed now in the latest service release, build 10.2.20102.2005. Please let me know if you have any further questions about this matter.
The XamTreeItem has an IsEnabled property which would disable the XamTreeItem and the checkbox item.
The other option would be set the CheckBoxStyle of the XamTreeItem and change the IsEnabled on a style object to style only the CheckBox object.
<UserControl.Resources>
<Style x:Key="cbStyle" TargetType="CheckBox" >
<Setter Property="Background" Value="Green"></Setter>
<Setter Property="BorderThickness" Value="1"></Setter>
<Setter Property="BorderBrush" Value="Red" ></Setter>
<Setter Property="IsEnabled" Value="False" ></Setter>
</Style>
</UserControl.Resources>
private void Button_Click(object sender, RoutedEventArgs e)
{
Style s = this.Resources["cbStyle"] as Style;
XamWebTreeItem ti = tree.ResolveXamWebTreeItem(tree.Items[1]);
ti.CheckBoxStyle = s;
//ti.IsEnabled = !ti.IsEnabled;
}
However there is a bug where setting this style won't correctly update. This should be resolved in the next service release and I will have our Developer Support staff create a case for you to be notified when this issue is resolved.
I want to update one thing here, the above mentioned is a XamWebTree with checkboxes for all the nodes.