I am trying to write the multiply selected tree nodes to a label - It seemed the node_click event would be what i need - however I've seen others have had some issues with it and apparently i am not going down the right path.
I don't see how to set the radtreeview control to autopostback = true
here is what i attempted
using
System;
using
System.Data;
using
System.Configuration;
using
System.Collections;
using
System.Web;
using
System.Web.Security;
using
System.Web.UI;
using
System.Web.UI.WebControls;
using
System.Web.UI.WebControls.WebParts;
using
System.Web.UI.HtmlControls;
using
System.Data.SqlClient;
using
Telerik.Web.UI;
public
partial class radman : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
RadTreeView1.DataSource = createOrgTreeTable();
RadTreeView1.DataFieldID =
"OrgId";
RadTreeView1.DataFieldParentID =
"OrgParent";
RadTreeView1.DataTextField =
"Name";
RadTreeView1.DataValueField =
"Name";
RadTreeView1.MultipleSelect =
true;
RadTreeView1.DataBind();
}
private DataTable createOrgTreeTable()
{
SqlConnection sqlConn = new SqlConnection(TPWConfiguration.DbConnectionString);
sqlConn.Open();
SqlCommand CmdRoot = new SqlCommand("tpw_direct_reports_listing_all", sqlConn);
CmdRoot.CommandType =
CommandType.StoredProcedure;
CmdRoot.Parameters.Add(
new SqlParameter("@UserId", SqlDbType.VarChar));
CmdRoot.Parameters[
"@UserID"].Value = "jjb000;
DataTable dtOrgTree = new DataTable();
dtOrgTree.Columns.Add(
"OrgId");
dtOrgTree.Columns.Add(
"OrgParent");
dtOrgTree.Columns.Add(
"login");
dtOrgTree.Columns.Add(
"name");
SqlDataAdapter daRoot = new SqlDataAdapter(CmdRoot);
daRoot.Fill(dtOrgTree);
return dtOrgTree;
}
protected void ShowSelected()
{
lblSelectedNodes.Text =
"";
foreach (RadTreeNode node in RadTreeView1.SelectedNodes)
{
lblSelectedNodes.Text +=
"<br/>" + node.FullPath;
}
}
protected void Button1_Click(object sender, EventArgs e)
{
ShowSelected();
}
}