treeview expand client-side attribute

Discussion in 'ASP .Net' started by =?Utf-8?B?U3dvb3No?=, Apr 20, 2007.

  1. i have a treeview
    (id="trv")

    i would like to do something like this:
    trv.Attributes.Add("onexpand", "javascript:alert(this);");


    i cannot make this work
    i would like to know if this is the way I should do it, or should i
    add some event somehow to each node


    basically i would like to do some javascript action on each expand -
    each (expanded) node
    (later on collapse too)


    i found this example in articles like this one:
    http://p2p.wrox.com/topic.asp?TOPIC_ID=46824


    basically i have somthing like this:


    nodeSection.NavigateUrl = "javascript:showMenu('Section', " +
    rowSection["ContractSectionId"].ToString() + ", " +
    rowSection.GetChildRows("SectionToGroup").Length.ToString() + ");";


    i would like to add an other feature like this, only this time i'd
    like to do it on expand / collapse ...


    thanks
     
    =?Utf-8?B?U3dvb3No?=, Apr 20, 2007
    #1
    1. Advertising

  2. =?Utf-8?B?U3dvb3No?=

    David Guest

    I just been trying to fix one of my own issues (styling the treeview). I
    found this site, then looking on the list of articles, found this link.

    http://www.java2s.com/Code/ASP/Components/TreeNodeExpandactionVBnet.htm

    Perhaps just what you want. It seems there is an onexpand attribute that you
    can already use.

    --
    Best regards,
    Dave Colliver.
    http://www.AshfieldFOCUS.com
    ~~
    http://www.FOCUSPortals.com - Local franchises available



    "Swoosh" <> wrote in message
    news:...
    >i have a treeview
    > (id="trv")
    >
    > i would like to do something like this:
    > trv.Attributes.Add("onexpand", "javascript:alert(this);");
    >
    >
    > i cannot make this work
    > i would like to know if this is the way I should do it, or should i
    > add some event somehow to each node
    >
    >
    > basically i would like to do some javascript action on each expand -
    > each (expanded) node
    > (later on collapse too)
    >
    >
    > i found this example in articles like this one:
    > http://p2p.wrox.com/topic.asp?TOPIC_ID=46824
    >
    >
    > basically i have somthing like this:
    >
    >
    > nodeSection.NavigateUrl = "javascript:showMenu('Section', " +
    > rowSection["ContractSectionId"].ToString() + ", " +
    > rowSection.GetChildRows("SectionToGroup").Length.ToString() + ");";
    >
    >
    > i would like to add an other feature like this, only this time i'd
    > like to do it on expand / collapse ...
    >
    >
    > thanks
    >
    >
    >
     
    David, Apr 20, 2007
    #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. Daves

    treeview expand on client

    Daves, May 11, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    499
    Daves
    May 11, 2006
  2. Dgorf

    Expand treeView web control using client script

    Dgorf, Jan 6, 2004, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    171
    Jeremy Carter
    Jan 12, 2004
  3. ROS

    Treeview : Client side expand node

    ROS, Oct 12, 2004, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    157
  4. Replies:
    0
    Views:
    150
  5. mehdi_mousavi
    Replies:
    0
    Views:
    176
    mehdi_mousavi
    Sep 27, 2005
Loading...

Share This Page