Esempio n. 1
0
        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;
            }
        }
Esempio n. 2
0
    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;
            }
        }
    }