treeview new client side events

Discussion in 'ASP .Net Web Controls' started by Sohail, Nov 7, 2003.

  1. Sohail

    Sohail Guest

    Does anyone know how to add 'onadd' and/or 'ondelete'
    events for the treeview?

    I want to be able to add/delete nodes to the treeview
    client-side and then postback to the server and let it do
    it's thing.

    Thanks,

    Sohail
    Sohail, Nov 7, 2003
    #1
    1. Advertising

  2. Sohail

    HD Guest

    you will need to do somethng like this

    public class CustomPager : System.Web.UI.WebControls.WebControl ,
    IPostBackEventHandler
    {
    public void RaisePostBackEvent(string eventArgument)
    {
    if ( eventArgument == "NextSet" )
    CurrentOffset += NoOfPageLinks;
    else if( eventArgument == "PrevSet" )
    CurrentOffset -= NoOfPageLinks;
    else
    {
    CurrentPage = int.Parse(eventArgument);
    }
    this.Parent.Load += Page.Page_Load();
    }

    protected override void Render(HtmlTextWriter writer)
    {
    int start =0;
    int end = 0;

    start = CurrentOffset;
    end = CurrentOffset + NoOfPageLinks;

    end = (end > TotalPages ? TotalPages+1 : end);

    writer.Write("<table cellspacing=0 cellpadding=0 border=0
    width=100%><tr>");
    writer.Write("<td align=left width=50>");
    if((start-NoOfPageLinks) > 0)
    {
    writer.Write("<a href=\"javascript:" +
    Page.GetPostBackEventReference(this,"PrevSet") + "\"><font
    color=black>&lt;&lt;</font></a>");
    }
    }
    }

    "Sohail" <> wrote in message
    news:0acf01c3a53e$77adf370$...
    > Does anyone know how to add 'onadd' and/or 'ondelete'
    > events for the treeview?
    >
    > I want to be able to add/delete nodes to the treeview
    > client-side and then postback to the server and let it do
    > it's thing.
    >
    > Thanks,
    >
    > Sohail
    HD, Nov 7, 2003
    #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. Mong
    Replies:
    5
    Views:
    4,714
    Kevin Spencer
    May 7, 2004
  2. Stuart Whiteford
    Replies:
    2
    Views:
    741
    Stuart Whiteford
    Apr 25, 2006
  3. Boss302
    Replies:
    0
    Views:
    1,035
    Boss302
    Nov 21, 2006
  4. alrotem
    Replies:
    0
    Views:
    445
    alrotem
    Jan 14, 2007
  5. Bogdan
    Replies:
    2
    Views:
    644
    Bogdan
    Jun 9, 2008
Loading...

Share This Page