帮忙给个例子!

解决方案 »

  1.   

    http://www.delphifans.com/SoftView/SoftView_947.html
    上边有详细的例子,可以看看
      

  2.   

    1.
    http://www.microsoft.com/china/msdn/archives/library/workshop/webcontrols/overview/treeview.asp2.
    引用:
    http://community.csdn.net/Expert/topic/4196/4196863.xml?temp=9.365261E-03
    http://community.csdn.net/Expert/topic/3169/3169028.xml?temp=.8414118
      

  3.   

    微软的TREEVIEW基本功能我都会了,我现在想了解的是梅花雪做的treeView,两篇文章我都看了,怎么就没看到如何从数据库提取数据的,能给我指一下吗,我看好象没有。
      

  4.   

    //后台方法
    public static string ConnectionString=System.Configuration .ConfigurationSettings .AppSettings["ConnectionString"];

    #region GetDataSet
    public static DataSet GetDataSet(string sql)
    {
    SqlDataAdapter sda =new SqlDataAdapter(sql,ConnectionString);
    DataSet ds=new DataSet();
    sda.Fill(ds);
    return ds;
    }
    #endregion
    protected string LoadTree()
    {
    string sql="select * from "+DataBase;
    DataSet ds=GetDataSet(sql);
    string node="";
    for(int m=0;m<ds.Tables[0].Rows.Count;m++)
    {
    node = node + "  tree.nodes["+"\""+ ds.Tables[0].Rows[m]["parentId"].ToString()+"_"+ ds.Tables[0].Rows[m]["id"].ToString()+"\""+"] = ";
    node = node + "\""+"text:"+ ds.Tables[0].Rows[m]["text"].ToString()+";";
    node = node + "hint:"+ds.Tables[0].Rows[m]["hint"].ToString()+";";
    node = node + "icon:"+ds.Tables[0].Rows[m]["icon"].ToString() +";";
    node = node + "data:"+ds.Tables[0].Rows[m]["data"].ToString()+";";
    node = node + "url:"+ds.Tables[0].Rows[m]["url"].ToString()+";";
    node = node + "target:"+ ds.Tables[0].Rows[m]["target"].ToString() +";";
    node = node + "method:"+ ds.Tables[0].Rows[m]["method"].ToString()+"\""+";";
    }
    return node;
    }
    --------------------------------
    //前台调用
    tree.setIconPath("http://www.meizz.com/Icons/TreeView/"); //可用相对路径
    <%=LoadTree()%>//调用后台数据库方法,产生树
    tree.setURL("default.aspx");
    tree.setTarget("meng");
      

  5.   

    把上面的
    string sql="select * from "+DataBase;
    改成
    string sql="select * from DataBasename";//传入数据库表,如treeview