HI,
I have a radtreeview in asp.net
I am dynamically building the radtreenodes and adding to the Radtreeview.
and I am dynamically adding the radgrid control to some of the node of the radtreeview.
plz find the below code
protected void createtreenodes()
{
RadTreeNode tNode1 = null;
RadTreeNodeCollection tnc = null;
rdTrNewBusiness.Nodes.Clear();
DataSet dsNode = new DataSet();
dsNode.ReadXml(Server.MapPath("~/XMLs/NewPolicyLinks.xml"));
dt = new DataTable();
dt = dsNode.Tables[0];
for (int j = 0; j < dt.Rows.Count; j++)
{
tNode1 = new RadTreeNode();
tNode1.Text = dt.Rows[j]["Name"].ToString();
rdTrNewBusiness.Nodes.Add(tNode1);
tNode1.ExpandMode = TreeNodeExpandMode.ServerSide;
if (tNode1.Text == "POLICY")
{
BindPolicy(tNode1);
}
else if (tNode1.Text == "ENTITIES")
{
NodeTxt = BindGrids(tNode1, tNode1.Text, "~/XMLs/EntitiesInfo.xml");
tNode1.Text = "ENTITIES" + " (" + NodeTxt + ")";
if (!object.Equals(Session["Node"], null))
{
if (Session["Node"].ToString().Trim().Length > 0)
{
tNode1.Expanded = true;
}
}
}
else if (tNode1.Text == "COVERAGE")
{
BindCoverage(tNode1);
}
else if (tNode1.Text == "VEHICLES")
{
NodeTxt = BindGrids(tNode1, tNode1.Text, "~/XMLs/Vehicle.xml");
tNode1.Text = "VEHICLES" + " (" + NodeTxt + ")";
}
else if (tNode1.Text == "DRIVERS")
{
NodeTxt = BindGrids(tNode1, tNode1.Text, "~/XMLs/DriversInfo.xml");
tNode1.Text = "DRIVERS" + " (" + NodeTxt + ")";
}
else if (tNode1.Text == "HISTORY")
{
NodeTxt = BindGrids(tNode1, tNode1.Text, "~/XMLs/CarrierInfo.xml");
tNode1.Text = "HISTORY" + " (" + NodeTxt + ")";
}
else if (tNode1.Text == "RATE")
{
BindRate(tNode1);
}
}
tnc = new RadTreeNodeCollection(rdTrNewBusiness);
tnc.Add(tNode1);
Cache["Tree"] = tnc;
dsNode = null;
}
The problem is when we are clicking on any grid row (which is dynamically constructed radgrid), all the tree nodes are in collapse mode, i want the node which is expanded with the grid to maintain the same state.
could any one plz help me how to maintain the state of the radtreeview which is dynamically created in postbacks.
I have a radtreeview in asp.net
I am dynamically building the radtreenodes and adding to the Radtreeview.
and I am dynamically adding the radgrid control to some of the node of the radtreeview.
plz find the below code
protected void createtreenodes()
{
RadTreeNode tNode1 = null;
RadTreeNodeCollection tnc = null;
rdTrNewBusiness.Nodes.Clear();
DataSet dsNode = new DataSet();
dsNode.ReadXml(Server.MapPath("~/XMLs/NewPolicyLinks.xml"));
dt = new DataTable();
dt = dsNode.Tables[0];
for (int j = 0; j < dt.Rows.Count; j++)
{
tNode1 = new RadTreeNode();
tNode1.Text = dt.Rows[j]["Name"].ToString();
rdTrNewBusiness.Nodes.Add(tNode1);
tNode1.ExpandMode = TreeNodeExpandMode.ServerSide;
if (tNode1.Text == "POLICY")
{
BindPolicy(tNode1);
}
else if (tNode1.Text == "ENTITIES")
{
NodeTxt = BindGrids(tNode1, tNode1.Text, "~/XMLs/EntitiesInfo.xml");
tNode1.Text = "ENTITIES" + " (" + NodeTxt + ")";
if (!object.Equals(Session["Node"], null))
{
if (Session["Node"].ToString().Trim().Length > 0)
{
tNode1.Expanded = true;
}
}
}
else if (tNode1.Text == "COVERAGE")
{
BindCoverage(tNode1);
}
else if (tNode1.Text == "VEHICLES")
{
NodeTxt = BindGrids(tNode1, tNode1.Text, "~/XMLs/Vehicle.xml");
tNode1.Text = "VEHICLES" + " (" + NodeTxt + ")";
}
else if (tNode1.Text == "DRIVERS")
{
NodeTxt = BindGrids(tNode1, tNode1.Text, "~/XMLs/DriversInfo.xml");
tNode1.Text = "DRIVERS" + " (" + NodeTxt + ")";
}
else if (tNode1.Text == "HISTORY")
{
NodeTxt = BindGrids(tNode1, tNode1.Text, "~/XMLs/CarrierInfo.xml");
tNode1.Text = "HISTORY" + " (" + NodeTxt + ")";
}
else if (tNode1.Text == "RATE")
{
BindRate(tNode1);
}
}
tnc = new RadTreeNodeCollection(rdTrNewBusiness);
tnc.Add(tNode1);
Cache["Tree"] = tnc;
dsNode = null;
}
The problem is when we are clicking on any grid row (which is dynamically constructed radgrid), all the tree nodes are in collapse mode, i want the node which is expanded with the grid to maintain the same state.
could any one plz help me how to maintain the state of the radtreeview which is dynamically created in postbacks.