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.
精彩评论