Product Bundles
DevCraft
All Telerik .NET and Kendo UI JavaScript components and AI Tools in one package.
Kendo UI
Bundle of AI Tools plus four JavaScript UI libraries built natively for jQuery, Angular, React and Vue.
Telerik
Build great .NET business apps
.Net Web
Cross-Platform
Desktop
Reporting and Documents
Testing & Mocking
Debugging
Build JavaScript UI
Javascript
AI for Developers & IT
Ensure AI program success
AI Coding
Additional Tools
Enhance the developer and designer experience
UI/UX Tools
Free Tools
CMS
Support and Learning
Productivity and Design Tools
How do I change a node's checkbox state when the user clicks on the node's label text as opposed to clicking on the checkbox itself?
This needs to work when the treeview is in Tri-state mode (needs to handle intedeterminate state as well as on/off).
Thanks
public
RadForm1()
{
InitializeComponent();
radTreeView1.Click += RadTreeView1_Click;
radTreeView1.NodeFormatting += RadTreeView1_NodeFormatting;
}
private
void
RadTreeView1_NodeFormatting(
object
sender, Telerik.WinControls.UI.TreeNodeFormattingEventArgs e)
e.NodeElement.ContentElement.ShouldHandleMouseInput =
true
;
RadTreeView1_Click(
sender, EventArgs e)
var element = radTreeView1.ElementTree.GetElementAtPoint(((MouseEventArgs)e).Location);
if
(element
is
TreeNodeContentElement)
var node = element.Parent
as
TreeNodeElement;
node.Data.Checked = !node.Data.Checked;
Thanks Dimitar, that worked.
-Lou