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. Advertisements

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. Robert V. Hanson
    Replies:
    2
    Views:
    585
    Robert Hanson
    Jul 1, 2003
  2. bill yeager

    selectedindex value not being updated

    bill yeager, Oct 15, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    437
    carlos medina
    Oct 15, 2003
  3. =?Utf-8?B?R3JhZW1lIENvdXR0cw==?=

    IE Treeview - selectedindex

    =?Utf-8?B?R3JhZW1lIENvdXR0cw==?=, Feb 8, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    543
    Alvin Bruney [MVP]
    Feb 8, 2005
  4. =?Utf-8?B?VHltYm93?=
    Replies:
    2
    Views:
    25,243
    =?Utf-8?B?VHltYm93?=
    Jan 10, 2006
  5. abargaddon
    Replies:
    0
    Views:
    1,253
    abargaddon
    Jan 17, 2008
  6. Per Salmi

    TreeView not rendering nodes? Cacheing of a TreeView

    Per Salmi, Oct 15, 2003, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    664
    Steve Drake
    Oct 15, 2003
  7. Ionutz
    Replies:
    2
    Views:
    815
    Ionutz
    Oct 23, 2005
  8. stepkurt

    Microsoft Treeview vs System Treeview

    stepkurt, Aug 29, 2007, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    632
    Teemu Keiski
    Sep 2, 2007
Loading...