TreeGrid-无限制树形GUCD (二)

2014-11-24 01:35:52 · 作者: · 浏览: 8








































AutoHeight="true" Width="450" Resizable="false" BodyStyle="background-color:#fff;"
Padding="15" Layout="FormLayout" ForceLayout="true" Hidden="true" Modal="true">

LabelStyle="margin:5px 0 5 0;" StyleSpec="margin:5px 0 5 0;" />
FieldLabel="父节点编号" LabelStyle="margin:5px 0 5 0;" StyleSpec="margin:5px 0 5 0;"
Text="-1" Hidden="true" />














CS:


[csharp] using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ext.Net;
using DzPlatForm.Control;
using System.Data;
using DzPlatForm.DBUtility;
namespace DzPlatForm.CRM.Property
{
public partial class Source : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
Session["utype"] = 1;
this.BuildTree(TreeGrid1.Root);

}
}
///


/// 初始化树形列表
///

///
///
private Ext.Net.TreeNodeCollection BuildTree(Ext.Net.TreeNodeCollection nodes)
{

if (Session["utype"] == null)
{
Response.Redirect("Login.aspx");
return null;
}
else
{

string sql = "SELECT [Id],[ParentId],[Name] FROM [OA].[dbo].[CustomerSource] ";

TreeTableControl treeTable = new TreeTableControl();

DataTable dt = DbHelperSQL.ExecuteDT(sql, null);
Ext.Net.TreeNode tvn = treeTable.BindTableTree(dt);
nodes.Add(tvn);
return nodes;
}

}
///
/// 刷新树形列表
///

///
[DirectMethod]
public string RefreshMenu()
{
TreeGrid1.Root.Clear();
Ext.Ne