Expand treeView web control using client script

Discussion in 'ASP .Net Web Controls' started by Dgorf, Jan 6, 2004.

  1. Dgorf

    Dgorf Guest

    Hey,
    I had some problems when tring 2 expand a treeViwe's node from
    javascript.
    B4 i change the selectedNodeIndex
    document.all("TreeView1").selectedNodeIndex = ar.getNodeIndex();
    I want 2 expand the current node (if the nodde is not expanded ,
    selectedNodeIndex will become "0"),
    but it seems that my code is not working (I'm calling
    expandCurrentLevel b4 changing selectedNodeIndex )

    function expandCurrentLevel()
    {

    var myNode = TreeView1.getTreeNode(TreeView1.selectedNodeIndex);

    myNode.Expanded = true;
    TreeView1.ExpandLevel+=1;

    }

    10x in advane

    Dgorf,
    ..Net programmer
    Dgorf, Jan 6, 2004
    #1
    1. Advertising

  2. try using
    myNode.setAttribute('Expanded', true);

    "Dgorf" <> wrote in message
    news:...
    > Hey,
    > I had some problems when tring 2 expand a treeViwe's node from
    > javascript.
    > B4 i change the selectedNodeIndex
    > document.all("TreeView1").selectedNodeIndex = ar.getNodeIndex();
    > I want 2 expand the current node (if the nodde is not expanded ,
    > selectedNodeIndex will become "0"),
    > but it seems that my code is not working (I'm calling
    > expandCurrentLevel b4 changing selectedNodeIndex )
    >
    > function expandCurrentLevel()
    > {
    >
    > var myNode = TreeView1.getTreeNode(TreeView1.selectedNodeIndex);
    >
    > myNode.Expanded = true;
    > TreeView1.ExpandLevel+=1;
    >
    > }
    >
    > 10x in advane
    >
    > Dgorf,
    > .Net programmer
    Jeremy Carter, Jan 12, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Gönen EREN
    Replies:
    4
    Views:
    4,036
    Gönen EREN
    Aug 16, 2003
  2. Daves

    treeview expand on client

    Daves, May 11, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    484
    Daves
    May 11, 2006
  3. =?Utf-8?B?U3dvb3No?=

    treeview expand client-side attribute

    =?Utf-8?B?U3dvb3No?=, Apr 20, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    980
    David
    Apr 20, 2007
  4. ROS

    Treeview : Client side expand node

    ROS, Oct 12, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    132
  5. mehdi_mousavi
    Replies:
    0
    Views:
    147
    mehdi_mousavi
    Sep 27, 2005
Loading...

Share This Page