XML : how to display only parent nodes in xml tree view control in asp.net?

we are loading the xml file path from a textbox as shown below

          Session["CurrentXMLFile"] = txtFilePath.Text;            LoadXMLTree(txtFilePath.Text);    

binding the xml file to tree view as shown below

  private void LoadXMLTree(string fileName)  {      try      {          xmlDataSource.DataFile = fileName;          xmlDataSource.EnableCaching = false;            xmlTreeView.DataSourceID = "xmlDataSource";            xmlTreeView.DataBind();        }    

This is the above code and i want to display only the parent nodes without the child node in the xml tree viewer.

No comments:

Post a Comment