Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TreeView Population on Demand

Status
Not open for further replies.

oscript

Programmer
Mar 25, 2003
63
GB
I am in the process of writing an application which exposes information from Scitegic's Pipeline Pilot product using web services.

I am able to expose the contents of the first level folder in the treeview but am struggling to see a nice way to do this for subsequent levels in the hierarchy.

The line which is causing me problems is the following:

private void TreeView1_Expand( object sender , Microsoft.Web.UI.WebControls.TreeViewClickEventArgs e)
{
....
<b>nodeFolder = ((Microsoft.Web.UI.WebControls.TreeView)sender).Nodes[(int.Parse(e.Node))];</b>
....

If the user is at level 0 things are OK ("5") but as soon as a level further down is reached the following value of e.Node is seen - "5.0" - which causes an error because of the int.Parse statement.

Does anyone have a nice way to dela with this in c# ?

Any help much appreciated,

Oscript

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top