开发者

Web Control TreeView select a Node programmatically

I use asp.net 4 and c#. I have a TreeView and I would like select an existing node programmtically.

SelectNode() method is read only

http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.treeview.selectednode.aspx

so I do not know how to do it. Please reply for a TreeView WEB CONTROL not for Win App.

My Code:

protected void uxTr开发者_运维百科eeView_DataBound(object sender, EventArgs e)
{
    TreeView myTreeView = (TreeView)uxManageSlotsDisplayer.FindControl("uxTreeView");
    myTreeView.Nodes[2].Selected = true;
}


You can try setting the Selected property of a particular TreeNode.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜