开发者

How to hide column in some nodes in Devexpress ASPxTreeList control?

开发者 https://www.devze.com 2023-03-30 21:14 出处:网络
I\'m using ASPxTrrList control from Devexpress and I want to hide delete button (or any column) in some nodes depending on specific condition.

I'm using ASPxTrrList control from Devexpress and I want to hide delete button (or any column) in some nodes depending on specific condition.

I tried (HtmlRowPrepared) event but I couldn't locate the column I want, it looks like its index changes depending on the node level.

Any way to 开发者_开发问答do this ?


I solved it using this code:

 protected void MyTree_HtmlCommandCellPrepared(object sender, TreeListHtmlCommandCellEventArgs e)
    {
        var node = MyTree.GetAllNodes().SingleOrDefault(k => k.Key == e.NodeKey);
        if (node != null && anyCondition)
            e.Cell.Visible = false;
    }  

I'm using only one command button, so I didn't try to hide specific button.

0

精彩评论

暂无评论...
验证码 换一张
取 消