protected void grdSitemap_HtmlRowPrepared(object sender, DevExpress.Web.ASPxTreeList.TreeListHtmlRowEventArgs e) { ASPxTreeList treeList = (ASPxTreeList)sender; ASPxCheckBox selectionCheckbox = null; foreach (TableCell cell in e.Row.Cells) { TreeListSelectionCell selectionCell = cell as TreeListSelectionCell; if (selectionCell != null) { selectionCheckbox = (ASPxCheckBox)selectionCell.Controls[0]; break; } } if (selectionCheckbox != null) { TreeListNode node = treeList.FindNodeByKeyValue(e.NodeKey); selectionCheckbox.Checked = true; } }
protected void ASPxTreeListDemo_HtmlRowPrepared(object sender, DevExpress.Web.ASPxTreeList.TreeListHtmlRowEventArgs e) { ASPxTreeList treeList = (ASPxTreeList)sender; WebControl selectionCheckbox = null; foreach (TableCell cell in e.Row.Cells) { TreeListSelectionCell selectionCell = cell as TreeListSelectionCell; if (selectionCell != null) { selectionCheckbox = (WebControl)selectionCell.Controls[0]; break; } } if (selectionCheckbox != null) { TreeListNode node = treeList.FindNodeByKeyValue(e.NodeKey); if (node.HasChildren) { selectionCheckbox.Enabled = false; } } }