Treeview selectedindex

Discussion in 'ASP .Net Web Controls' started by Sohail, Oct 16, 2003.

  1. Sohail

    Sohail Guest

    Hey guys,

    I havent been in ASP.NET for a while so I may just have
    forgotten how to do this.

    I have a treeview of which I'm trying to get the selected
    node on a postback (i.e., server side). For some reason it
    is always coming out as 0. Is there some property I have
    to set here? Here is the code:

    private void Page_Load(object sender, System.EventArgs e)
    {
    if (!IsPostBack)
    {
    Stream s = Database.RunXmlStoredProcedure
    (DSN.DSN_ENVISION, "sp_DOT_ExportTool_DBSchemaAsTreeViewXml
    ",new string[0],new object[0],"TREENODES");
    StreamReader sr = new StreamReader(s);
    s.Position = 0;
    dbSchema.TreeNodeSrc = sr.ReadToEnd();
    dbSchema.DataBind();
    }
    }

    private void btnSelect_Click(object sender,
    System.EventArgs e)
    {
    // this method is purely to test selectedindex
    pnlSchema.Visible = false;
    Response.Write(dbSchema.SelectedNodeIndex);
    }

    Any help would be appreciated

    Thanks,

    Sohail
     
    Sohail, Oct 16, 2003
    #1
    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. =?Utf-8?B?R3JhZW1lIENvdXR0cw==?=

    IE Treeview - selectedindex

    =?Utf-8?B?R3JhZW1lIENvdXR0cw==?=, Feb 8, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    458
    Alvin Bruney [MVP]
    Feb 8, 2005
  2. =?Utf-8?B?VHltYm93?=
    Replies:
    2
    Views:
    24,484
    =?Utf-8?B?VHltYm93?=
    Jan 10, 2006
  3. abargaddon
    Replies:
    0
    Views:
    1,070
    abargaddon
    Jan 17, 2008
  4. Per Salmi

    TreeView not rendering nodes? Cacheing of a TreeView

    Per Salmi, Oct 15, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    478
    Steve Drake
    Oct 15, 2003
  5. Ionutz
    Replies:
    2
    Views:
    537
    Ionutz
    Oct 23, 2005
Loading...

Share This Page