I am using a tree view control . Based upon the node selection I want to display some text into the text boxes . I have pasted part of my code below.
But I am not getting any value to the text boxes .
protected void rtvDetailData_NodeExpand(object sender, RadTreeNodeEventArgs e)
{
SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["codingspecialsConnectionString"].ConnectionString);
SqlCommand selectCommand = new SqlCommand(@"select Heirarchy.childid AS NodeId , Heirarchy.childdescription AS NodeText , Heirarchy.Name, Heirarchy.UPCCode , Heirarchy.CNAN , COUNT(Children.childid) AS ChildCount from Heirarchy LEFT JOIN Heirarchy As Children ON Heirarchy.childid = Children.childid WHERE Heirarchy.ParentID = @parentId GROUP BY Heirarchy.childid , Heirarchy.childdescription , Heirarchy.Name, Heirarchy.UPCCode , Heirarchy.CNAN ", connection);
selectCommand.Parameters.AddWithValue("parentId", e.Node.Value);
SqlDataAdapter adapter = new SqlDataAdapter(selectCommand);
DataTable data = new DataTable();
adapter.Fill(data);
foreach (DataRow row in data.Rows)
{
RadTreeNode node = new RadTreeNode();
node.Text = row["NodeText"].ToString();
node.Value = row["NodeId"].ToString();
txtName.Text = row["NodeText"].ToString();
txtUPCCode.Text = row["UPCCode"].ToString();
txtCNANNum.Text = row["CNAN"].ToString();
if (Convert.ToInt32(row["ChildCount"]) > 0)
{
node.ExpandMode = TreeNodeExpandMode.ServerSideCallBack;
}
e.Node.Nodes.Add(node);
}
e.Node.Expanded = true;
}
Can you tell me where I am doing the mistake .
With Thanks & Regards
Manoj