你的节点中的内容是包括所有子节点吗?不知道lz希望在datagrid中显示怎样的列?

解决方案 »

  1.   

    是的 包含字列,我想在datagrid中显示每个节点的内容和类型
      

  2.   

    using System;
    using System.Windows.Forms;namespace OKMDBrowser
    {
    public class  hzvf009_t 
    {  
                               
    public short  area;
    public short    fu;                   

                
    public TreeNode getNodes() 
    {

    TreeNode rootNode = new TreeNode(); rootNode.Text = "HZVF009";
    rootNode.ImageIndex = 0;
    rootNode.SelectedImageIndex = 1;

    TreeNode cND1 = new TreeNode();
    TreeNode cND2 = new TreeNode();
    cND1.Text = "area("+area.GetType().ToString().Remove(0,6)+")";
    cND2.Text = "fu("+fu.GetType().ToString().Remove(0,6)+")";
    //cND3.Text = "cno("+cno.GetType().ToString().Remove(0,6)+")"; cND1.ImageIndex = 0;
    cND1.SelectedImageIndex = 1;  
    cND2.SelectedImageIndex = 1;  
    rootNode.Nodes.Add(cND1);
    rootNode.Nodes.Add(cND2);
    return rootNode; }
    } ;
    }上面是我要读取得数据源和treeview,我现在用了dataSet 和datagrid 想把数据源绑定到dataSet,然后再datagrid 上显示每个选中接点的名称,类型,内容
      

  3.   

    我有以前写了一个ajax的树形控件,是vs2003时的,现在的2005就很简简了,有这个控件啊,很好用的 .
      

  4.   

    是啊 但是boss要用2003 没办法啊 ,真想来个高人解决下阿