webTreeView in server side

1 reply. Last post: September 19, 2014 9:19 AM by Yudi
Tags :
Luís DamasMember

Is it possible to obtain the nodes, checkednodes, etc.... using vb.net or C# ?

Or is it only possible using client access?


All Replies

Yudi Member

The snippet code below shows how to obtain checked nodes of WebTreeView in code behind (C#).

protected void Button1_Click(object sender, EventArgs e){
    TextBox1.Text = "Checked nodes are : \n";

    for (int i = 0; i < WebTreeView1.CheckedNodes.Count; i++)
    {
        WebTreeViewNode checkedNodes = WebTreeView1.CheckedNodes[i] as WebTreeViewNode;

        if (checkedNodes != null)
            TextBox1.Text += checkedNodes.Text + " ; \n";
    }
}

To obtain WebTreeView nodes, please try to use the Nodes property of WebTreeView. It is a collection of WebTreeViewNodeBinding. For example:

WebTreeViewNodeCollection nodes = WebTreeView1.Nodes;

Hope this help.

All times are GMT -5. The time now is 5:21 AM.
Previous Next