public partial class _Default : System.Web.UI.Page
{
List lst = new List();
int mainnode = 0;
protected void Page_Load(object sender, EventArgs e)
{
if(!Page.IsPostBack)
RadTreeView1.Nodes.Insert(0, new RadTreeNode(“Table of Content”));
}

protected void Button1_Click(object sender, EventArgs e)
{
updatemainnode();
lst.Add(“end”);

gv1.DataSource = lst;
gv1.DataBind();
}

public void updatemainnode()
{
for (int i = 0; i 0)
{
mainnode = i;
string str = i.ToString();
lst.Add(str);
updatesubnode(RadTreeView1.Nodes[i]);
ViewState[“BookIndex”] = null;
}
}
}

public void updatesubnode(RadTreeNode treenode)
{
if (ViewState[“BookIndex”] == null)
{
ViewState[“BookIndex”] = mainnode;
}

for (int i = 0; i 0)
{
ViewState[“BookIndex”] = strBookindex;
updatesubnode(treenode.Nodes[i]);
}
}
string strnew = ViewState[“BookIndex”].ToString();
if (strnew.Contains(“.”))
{
strnew = strnew.Remove(strnew.LastIndexOf(“.”));
ViewState[“BookIndex”] = strnew;
}
}
}