开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜