How would someone go about adding check boxes to only the children of a tree view in XAML? My goal is to have a tree view where the parent is just a text block and all the children are check boxes but only one child can be checked at a time. I have no problem making the whole the tree view check boxes but I am not sure how to get what I really want Any suggestions?
Thanks.
Why don't you just do it in code? Like this:
TreeViewItem newItem = new TreeViewItem()
{
Header = "One"
};
treeViewObjects.Items.Add(newItem);
TreeViewItem newItem1 = new TreeViewItem()
{
Header = new CheckBox()
{
Content = "Two"
}
};
newItem.Items.Add(newItem1);
Try this Working with Checkboxes in the WPF TreeView.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With