Treeview selectedindex

S

Sohail

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top