This example shows how to show checkboxes within nodes displayed at a specified tree level and hide/disable checkboxes for other nodes.
The CustomDrawNodeCheckBox event is handled to hide checkboxes or set them to disabled.
void treeList_CustomDrawNodeCheckBox(object sender, CustomDrawNodeCheckBoxEventArgs e) {
bool canCheckNode = CanCheckNode(e.Node);
if (canCheckNode)
return;
e.ObjectArgs.State = DevExpress.Utils.Drawing.ObjectState.Disabled;
e.Handled = NeedHide;
}
The BeforeCheckNode event is handled to prevent users from changing the state of disabled checkboxes.
void treeList_BeforeCheckNode(object sender, CheckNodeEventArgs e) {
e.CanCheck = CanCheckNode(e.Node);
}
(you will be redirected to DevExpress.com to submit your response)