DEVEXPRESS-----TREELIST 的 增加、删除节点

  注意采用了两个treeListColumn,一个用来展示名称,一个用来展示编码.这样的好处在于作品名维护的时候,可以调用编码,而不需要重新匹配对比了.下面是完整的代码.

using  System;
using  System.Drawing;
using  System. Collections;
using  System.ComponentModel;
using  System.Windows.Forms;

namespace  WindowsApplication1
{
    
/**/ ///   <summary>
    
///  typemanage  的摘要说明。
    
///   </summary>
     public   class  typemanage : System.Windows.Forms.Form
    
{
        
private  DevExpress.XtraEditors.TextEdit textEdit1;
        
private  DevExpress.XtraTreeList.TreeList treeList1;
        
private  DevExpress.XtraTreeList.Columns.TreeListColumn treeListColumn1;
        
private  DevExpress.XtraEditors.Repository.RepositoryItemTextEdit repositoryItemTextEdit1;
        
private  DevExpress.XtraEditors.SimpleButton simpleButton1;
        
private  DevExpress.XtraEditors.SimpleButton simpleButton2;
        
private  DevExpress.XtraEditors.SimpleButton simpleButton3;
        
private  System.Windows.Forms.Label label1;
        
int  nodeid=0;
        DevExpress.XtraTreeList.Nodes.TreeListNode deletenode;
        
private  DevExpress.XtraTreeList.Columns.TreeListColumn treeListColumn2;
        
private  DevExpress.XtraEditors.Repository.RepositoryItemTextEdit repositoryItemTextEdit2;
        
private  System.Windows.Forms.Label label2;
        
private  DevExpress.XtraEditors.TextEdit textEdit2;
        
/**/ ///   <summary>
        
///   必需的设计器变量。
        
///   </summary>
         private  System.ComponentModel.Container components =  null ;

        
public  typemanage()
        
{
            
//
            // Windows 
窗体设计器支持所必需的
            //
            InitializeComponent();

            
//
            // TODO: 
 InitializeComponent  调用后添加任何构造函数代码
            //
        }

        
/**/ ///   <summary>
        
///   清理所有正在使用的资源。
        
///   </summary>
         protected   override   void  Dispose(  bool  disposing )
        
{
            
if ( disposing )
            
{
                
if (components !=  null )
                
{
                    components.Dispose();
                }
            }
            
base .Dispose( disposing );
        }

        
Windows  窗体设计器生成的代码 #region  Windows  窗体设计器生成的代码
        
/**/ ///   <summary>
        
///   设计器支持所需的方法  -  不要使用代码编辑器修改
        
///   此方法的内容。
        
///   </summary>
         private   void  InitializeComponent()
        
{
            
this .textEdit1 =  new  DevExpress.XtraEditors.TextEdit();
            
this .treeList1 =  new  DevExpress.XtraTreeList.TreeList();
            
this .treeListColumn1 =  new  DevExpress.XtraTreeList.Columns.TreeListColumn();
            
this .repositoryItemTextEdit1 =  new  DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
            
this .simpleButton1 =  new  DevExpress.XtraEditors.SimpleButton();
            
this .simpleButton2 =  new  DevExpress.XtraEditors.SimpleButton();
            
this .simpleButton3 =  new  DevExpress.XtraEditors.SimpleButton();
            
this .label1 =  new  System.Windows.Forms.Label();
            
this .treeListColumn2 =  new  DevExpress.XtraTreeList.Columns.TreeListColumn();
            
this .repositoryItemTextEdit2 =  new  DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
            
this .label2 =  new  System.Windows.Forms.Label();
            
this .textEdit2 =  new  DevExpress.XtraEditors.TextEdit();
            ((System.ComponentModel.ISupportInitialize)(
this .textEdit1.Properties)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(
this .treeList1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(
this .repositoryItemTextEdit1)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(
this .repositoryItemTextEdit2)).BeginInit();
            ((System.ComponentModel.ISupportInitialize)(
this .textEdit2.Properties)).BeginInit();
            
this .SuspendLayout();
            
// 
            // textEdit1
            // 
             this .textEdit1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            
this .textEdit1.EditValue = " 新增 1";
            
this .textEdit1.Location =  new  System.Drawing.Point(88, 248);
            
this .textEdit1.Name = "textEdit1";
            
this .textEdit1.Size =  new  System.Drawing.Size(128, 21);
            
this .textEdit1.TabIndex = 12;
            
// 
            // treeList1
            // 
             this .treeList1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
                | System.Windows.Forms.AnchorStyles.Right)));
            
this .treeList1.Columns.AddRange( new  DevExpress.XtraTreeList.Columns.TreeListColumn[]  {
                                                                                                     
this .treeListColumn1,
                                                                                                     
this .treeListColumn2});
            
this .treeList1.Location =  new  System.Drawing.Point(224, 16);
            
this .treeList1.Name = "treeList1";
            
this .treeList1.BeginUnboundLoad();
            
this .treeList1.AppendNode( new   object []  {
                                                       "
型材 ",
                                                       "01"}, -1);
            
this .treeList1.AppendNode( new   object []  {
                                                       "
门窗五金 ",
                                                       "02"}, -1);
            
this .treeList1.AppendNode( new   object []  {
                                                       "
辅料 ",
                                                       "03"}, -1);
            
this .treeList1.AppendNode( new   object []  {
                                                       "
中空玻璃用料 ",
                                                       "04"}, -1);
            
this .treeList1.EndUnboundLoad();
            
this .treeList1.RepositoryItems.AddRange( new  DevExpress.XtraEditors.Repository.RepositoryItem[]  {
                                                                                                               
this .repositoryItemTextEdit1,
                                                                                                               
this .repositoryItemTextEdit2});
            
this .treeList1.Size =  new  System.Drawing.Size(264, 264);
            
this .treeList1.Styles.AddReplace("Preview",  new  DevExpress.Utils.ViewStyle("Preview", "TreeList",  new  System.Drawing.Font("Tahoma", 10F), "", DevExpress.Utils.StyleOptions.StyleEnabled,  true true false , DevExpress.Utils.HorzAlignment.Near, DevExpress.Utils.VertAlignment.Center,  null , System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(255))), System.Drawing.Color.FromArgb(((System.Byte)(10)), ((System.Byte)(36)), ((System.Byte)(106)))));
            
this .treeList1.Styles.AddReplace("FooterPanel",  new  DevExpress.Utils.ViewStyle("FooterPanel", "TreeList",  new  System.Drawing.Font("Tahoma", 10F), "", DevExpress.Utils.StyleOptions.StyleEnabled,  true false false , DevExpress.Utils.HorzAlignment.Far, DevExpress.Utils.VertAlignment.Center,  null , System.Drawing.Color.FromArgb(((System.Byte)(212)), ((System.Byte)(208)), ((System.Byte)(200))), System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(0)))));
            
this .treeList1.Styles.AddReplace("GroupButton",  new  DevExpress.Utils.ViewStyle("GroupButton", "TreeList",  new  System.Drawing.Font("Tahoma", 10F), "", DevExpress.Utils.StyleOptions.StyleEnabled,  true false false , DevExpress.Utils.HorzAlignment.Default, DevExpress.Utils.VertAlignment.Center,  null , System.Drawing.Color.FromArgb(((System.Byte)(252)), ((System.Byte)(248)), ((System.Byte)(240))), System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(0)))));
            
this .treeList1.Styles.AddReplace("EvenRow",  new  DevExpress.Utils.ViewStyle("EvenRow", "TreeList",  new  System.Drawing.Font("Tahoma", 10F), "", DevExpress.Utils.StyleOptions.StyleEnabled,  true false false , DevExpress.Utils.HorzAlignment.Default, DevExpress.Utils.VertAlignment.Center,  null , System.Drawing.Color.FromArgb(((System.Byte)(212)), ((System.Byte)(208)), ((System.Byte)(200))), System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(0)))));
            
this .treeList1.Styles.AddReplace("TreeLine",  new  DevExpress.Utils.ViewStyle("TreeLine", "TreeList",  new  System.Drawing.Font("Microsoft Sans Serif", 8F), "", DevExpress.Utils.StyleOptions.StyleEnabled,  true false false , DevExpress.Utils.HorzAlignment.Default, DevExpress.Utils.VertAlignment.Center,  null , System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(255))), System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(128)))));
            
this .treeList1.Styles.AddReplace("PressedColumn",  new  DevExpress.Utils.ViewStyle("PressedColumn", "TreeList",  new  System.Drawing.Font("Tahoma", 10F, System.Drawing.FontStyle.Bold), "HeaderPanel", ((DevExpress.Utils.StyleOptions)(((DevExpress.Utils.StyleOptions.StyleEnabled | DevExpress.Utils.StyleOptions.UseBackColor) 
                | DevExpress.Utils.StyleOptions.UseForeColor))), 
true false false , DevExpress.Utils.HorzAlignment.Near, DevExpress.Utils.VertAlignment.Center,  null , System.Drawing.Color.FromArgb(((System.Byte)(10)), ((System.Byte)(36)), ((System.Byte)(106))), System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(255)))));
            
this .treeList1.Styles.AddReplace("HideSelectionRow",  new  DevExpress.Utils.ViewStyle("HideSelectionRow", "TreeList",  new  System.Drawing.Font("Tahoma", 10F), "", ((DevExpress.Utils.StyleOptions)((((((DevExpress.Utils.StyleOptions.StyleEnabled | DevExpress.Utils.StyleOptions.UseBackColor) 
                | DevExpress.Utils.StyleOptions.UseDrawFocusRect) 
                | DevExpress.Utils.StyleOptions.UseFont) 
                | DevExpress.Utils.StyleOptions.UseForeColor) 
                | DevExpress.Utils.StyleOptions.UseImage))), 
true false false , DevExpress.Utils.HorzAlignment.Default, DevExpress.Utils.VertAlignment.Center,  null , System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(128))), System.Drawing.Color.FromArgb(((System.Byte)(212)), ((System.Byte)(208)), ((System.Byte)(200)))));
            
this .treeList1.Styles.AddReplace("GroupFooter",  new  DevExpress.Utils.ViewStyle("GroupFooter", "TreeList",  new  System.Drawing.Font("Tahoma", 8F), "", DevExpress.Utils.StyleOptions.StyleEnabled,  true false false , DevExpress.Utils.HorzAlignment.Far, DevExpress.Utils.VertAlignment.Center,  null , System.Drawing.Color.FromArgb(((System.Byte)(222)), ((System.Byte)(218)), ((System.Byte)(210))), System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(0)))));
            
this .treeList1.Styles.AddReplace("HorzLine",  new  DevExpress.Utils.ViewStyle("HorzLine", "TreeList",  new  System.Drawing.Font("Tahoma", 10F), "", DevExpress.Utils.StyleOptions.StyleEnabled,  true false false , DevExpress.Utils.HorzAlignment.Default, DevExpress.Utils.VertAlignment.Center,  null , System.Drawing.Color.FromArgb(((System.Byte)(212)), ((System.Byte)(208)), ((System.Byte)(200))), System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(128)))));
            
this .treeList1.Styles.AddReplace("HeaderPanel",  new  DevExpress.Utils.ViewStyle("HeaderPanel", "TreeList",  new  System.Drawing.Font("Tahoma", 10F, System.Drawing.FontStyle.Bold), "", DevExpress.Utils.StyleOptions.StyleEnabled,  true false false , DevExpress.Utils.HorzAlignment.Near, DevExpress.Utils.VertAlignment.Center,  null , System.Drawing.Color.FromArgb(((System.Byte)(212)), ((System.Byte)(208)), ((System.Byte)(200))), System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(0)))));
            
this .treeList1.Styles.AddReplace("Empty",  new  DevExpress.Utils.ViewStyle("Empty", "TreeList",  new  System.Drawing.Font("Microsoft Sans Serif", 8F), "", DevExpress.Utils.StyleOptions.StyleEnabled,  true false false , DevExpress.Utils.HorzAlignment.Default, DevExpress.Utils.VertAlignment.Center,  null , System.Drawing.Color.FromArgb(((System.Byte)(232)), ((System.Byte)(228)), ((System.Byte)(220))), System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(255)))));
            
this .treeList1.Styles.AddReplace("VertLine",  new  DevExpress.Utils.ViewStyle("VertLine", "TreeList",  new  System.Drawing.Font("Tahoma", 10F), "", DevExpress.Utils.StyleOptions.StyleEnabled,  true false false , DevExpress.Utils.HorzAlignment.Near, DevExpress.Utils.VertAlignment.Center,  null , System.Drawing.Color.FromArgb(((System.Byte)(212)), ((System.Byte)(208)), ((System.Byte)(200))), System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(128)))));
            
this .treeList1.Styles.AddReplace("FocusedCell",  new  DevExpress.Utils.ViewStyle("FocusedCell", "TreeList",  new  System.Drawing.Font("Tahoma", 10F), "", ((DevExpress.Utils.StyleOptions)((((((DevExpress.Utils.StyleOptions.StyleEnabled | DevExpress.Utils.StyleOptions.UseBackColor) 
                | DevExpress.Utils.StyleOptions.UseDrawFocusRect) 
                | DevExpress.Utils.StyleOptions.UseFont) 
                | DevExpress.Utils.StyleOptions.UseForeColor) 
                | DevExpress.Utils.StyleOptions.UseImage))), 
true false false , DevExpress.Utils.HorzAlignment.Default, DevExpress.Utils.VertAlignment.Center,  null , System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(225))), System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(0)))));
            
this .treeList1.Styles.AddReplace("OddRow",  new  DevExpress.Utils.ViewStyle("OddRow", "TreeList",  new  System.Drawing.Font("Tahoma", 10F), "", DevExpress.Utils.StyleOptions.StyleEnabled,  true false false , DevExpress.Utils.HorzAlignment.Default, DevExpress.Utils.VertAlignment.Center,  null , System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(255))), System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(0)))));
            
this .treeList1.Styles.AddReplace("SelectedRow",  new  DevExpress.Utils.ViewStyle("SelectedRow", "TreeList",  new  System.Drawing.Font("Tahoma", 10F), "", ((DevExpress.Utils.StyleOptions)((((((DevExpress.Utils.StyleOptions.StyleEnabled | DevExpress.Utils.StyleOptions.UseBackColor) 
                | DevExpress.Utils.StyleOptions.UseDrawFocusRect) 
                | DevExpress.Utils.StyleOptions.UseFont) 
                | DevExpress.Utils.StyleOptions.UseForeColor) 
                | DevExpress.Utils.StyleOptions.UseImage))), 
true false false , DevExpress.Utils.HorzAlignment.Default, DevExpress.Utils.VertAlignment.Center,  null , System.Drawing.Color.FromArgb(((System.Byte)(20)), ((System.Byte)(46)), ((System.Byte)(116))), System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(255)))));
            
this .treeList1.Styles.AddReplace("FocusedRow",  new  DevExpress.Utils.ViewStyle("FocusedRow", "TreeList",  new  System.Drawing.Font("Tahoma", 10F), "", ((DevExpress.Utils.StyleOptions)((((((DevExpress.Utils.StyleOptions.StyleEnabled | DevExpress.Utils.StyleOptions.UseBackColor) 
                | DevExpress.Utils.StyleOptions.UseDrawFocusRect) 
                | DevExpress.Utils.StyleOptions.UseFont) 
                | DevExpress.Utils.StyleOptions.UseForeColor) 
                | DevExpress.Utils.StyleOptions.UseImage))), 
true false false , DevExpress.Utils.HorzAlignment.Default, DevExpress.Utils.VertAlignment.Center,  null , System.Drawing.Color.FromArgb(((System.Byte)(10)), ((System.Byte)(36)), ((System.Byte)(106))), System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(255)))));
            
this .treeList1.Styles.AddReplace("Row",  new  DevExpress.Utils.ViewStyle("Row", "TreeList",  new  System.Drawing.Font("Tahoma", 10F), "", DevExpress.Utils.StyleOptions.StyleEnabled,  true false false , DevExpress.Utils.HorzAlignment.Default, DevExpress.Utils.VertAlignment.Center,  null , System.Drawing.Color.FromArgb(((System.Byte)(255)), ((System.Byte)(255)), ((System.Byte)(255))), System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(0)))));
            
this .treeList1.TabIndex = 23;
            
this .treeList1.Text = " 类型维护 ";
            
this .treeList1.FocusedNodeChanged +=  new  DevExpress.XtraTreeList.FocusedNodeChangedEventHandler( this .treeList1_FocusedNodeChanged);
            
this .treeList1.AfterFocusNode +=  new  DevExpress.XtraTreeList.NodeEventHandler( this .treeList1_AfterFocusNode);
            
// 
            // treeListColumn1
            // 
             this .treeListColumn1.Caption = " 类型维护 ---- 绿城铝业 ";
            
this .treeListColumn1.ColumnEdit =  this .repositoryItemTextEdit1;
            
this .treeListColumn1.FieldName = " 类型维护 ---- 绿城铝业 ";
            
this .treeListColumn1.Name = "treeListColumn1";
            
this .treeListColumn1.VisibleIndex = 0;
            
// 
            // repositoryItemTextEdit1
            // 
             this .repositoryItemTextEdit1.AutoHeight =  false ;
            
this .repositoryItemTextEdit1.Name = "repositoryItemTextEdit1";
            
// 
            // simpleButton1
            // 
             this .simpleButton1.ButtonStyle = DevExpress.XtraEditors.Controls.BorderStyles.Office2003;
            
this .simpleButton1.Location =  new  System.Drawing.Point(40, 24);
            
this .simpleButton1.Name = "simpleButton1";
            
this .simpleButton1.TabIndex = 27;
            
this .simpleButton1.Text = "  新增根 ";
            
this .simpleButton1.Click +=  new  System.EventHandler( this .simpleButton1_Click);
            
// 
            // simpleButton2
            // 
             this .simpleButton2.ButtonStyle = DevExpress.XtraEditors.Controls.BorderStyles.Office2003;
            
this .simpleButton2.Location =  new  System.Drawing.Point(40, 128);
            
this .simpleButton2.Name = "simpleButton2";
            
this .simpleButton2.TabIndex = 28;
            
this .simpleButton2.Text = " 删除节点 ";
            
this .simpleButton2.Click +=  new  System.EventHandler( this .simpleButton2_Click);
            
// 
            // simpleButton3
            // 
             this .simpleButton3.ButtonStyle = DevExpress.XtraEditors.Controls.BorderStyles.Office2003;
            
this .simpleButton3.Location =  new  System.Drawing.Point(40, 80);
            
this .simpleButton3.Name = "simpleButton3";
            
this .simpleButton3.TabIndex = 30;
            
this .simpleButton3.Text = "  新增子极 ";
            
this .simpleButton3.Click +=  new  System.EventHandler( this .simpleButton3_Click);
            
// 
            // label1
            // 
             this .label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            
this .label1.Location =  new  System.Drawing.Point(8, 256);
            
this .label1.Name = "label1";
            
this .label1.Size =  new  System.Drawing.Size(80, 16);
            
this .label1.TabIndex = 31;
            
this .label1.Text = " 新增节点名称 ";
            
// 
            // treeListColumn2
            // 
             this .treeListColumn2.Caption = " 对应编码 ";
            
this .treeListColumn2.ColumnEdit =  this .repositoryItemTextEdit2;
            
this .treeListColumn2.FieldName = "treeListColumn2";
            
this .treeListColumn2.Name = "treeListColumn2";
            
this .treeListColumn2.VisibleIndex = 1;
            
// 
            // repositoryItemTextEdit2
            // 
             this .repositoryItemTextEdit2.AutoHeight =  false ;
            
this .repositoryItemTextEdit2.Name = "repositoryItemTextEdit2";
            
// 
            // label2
            // 
             this .label2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            
this .label2.Location =  new  System.Drawing.Point(8, 288);
            
this .label2.Name = "label2";
            
this .label2.Size =  new  System.Drawing.Size(80, 16);
            
this .label2.TabIndex = 33;
            
this .label2.Text = " 节点对应代码 ";
            
// 
            // textEdit2
            // 
             this .textEdit2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
            
this .textEdit2.EditValue = "05";
            
this .textEdit2.Location =  new  System.Drawing.Point(88, 280);
            
this .textEdit2.Name = "textEdit2";
            
this .textEdit2.Size =  new  System.Drawing.Size(128, 21);
            
this .textEdit2.TabIndex = 32;
            
// 
            // typemanage
            // 
             this .AutoScaleBaseSize =  new  System.Drawing.Size(5, 13);
            
this .ClientSize =  new  System.Drawing.Size(496, 333);
            
this .Controls.Add( this .label2);
            
this .Controls.Add( this .textEdit2);
            
this .Controls.Add( this .label1);
            
this .Controls.Add( this .simpleButton3);
            
this .Controls.Add( this .simpleButton2);
            
this .Controls.Add( this .simpleButton1);
            
this .Controls.Add( this .treeList1);
            
this .Controls.Add( this .textEdit1);
            
this .Name = "typemanage";
            
this .Text = " 类型管理 ";
            ((System.ComponentModel.ISupportInitialize)(
this .textEdit1.Properties)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(
this .treeList1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(
this .repositoryItemTextEdit1)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(
this .repositoryItemTextEdit2)).EndInit();
            ((System.ComponentModel.ISupportInitialize)(
this .textEdit2.Properties)).EndInit();
            
this .ResumeLayout( false );

        }
        
#endregion

        
private   void  simpleButton1_Click( object  sender, System.EventArgs e)
        
{
            
if (textEdit1.Text.Trim()==""||textEdit2.Text.Trim()=="")
            
{
                MessageBox.Show("
请输入对应名称及编码 !"," 错误 ",MessageBoxButtons.OK,MessageBoxIcon.Warning);
                
return ;
            }
            
this .treeList1.AppendNode( new   object []  { this .textEdit1.Text,textEdit2.Text},-1);

        
//            newnode.
        //            this.treeList1.Nodes[0].Nodes.Add(newnode);
       }

        
private   void  treeList1_FocusedNodeChanged( object  sender, DevExpress.XtraTreeList.FocusedNodeChangedEventArgs e)
        
{
            MessageBox.Show(e.Node.Level.ToString());
            MessageBox.Show(e.Node.Id.ToString());
            MessageBox.Show(e.Node.GetDisplayText(0));
        }

        
private   void  treeList1_AfterFocusNode( object  sender, DevExpress.XtraTreeList.NodeEventArgs e)
        
{
            nodeid=e.Node.Id;
            deletenode=e.Node;
        }

        
private   void  simpleButton3_Click( object  sender, System.EventArgs e)
        
{
            
if (textEdit1.Text.Trim()==""||textEdit2.Text.Trim()=="")
            
{
                MessageBox.Show("
请输入对应名称及编码 !"," 错误 ",MessageBoxButtons.OK,MessageBoxIcon.Warning);
                
return ;
            }
            
this .treeList1.AppendNode( new   object []  { this .textEdit1.Text,textEdit2.Text},nodeid);
        }

        
private   void  simpleButton2_Click( object  sender, System.EventArgs e)
        
{
//            MessageBox.Show(nodeid.ToString());
             this .treeList1.DeleteNode(deletenode);
        }
    }
}
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
### 回答1: DevExpress是一家提供软件开发工具的技术公司,旗下的产品包括很多有助于开发者提高开发效率和质量的工具和组件。而csdn是一个专门为程序员提供学习、交流和分享的在线社区。所以, "devexpress20-44155 csdn"可能是指在CSDN论坛上有关于DevExpress产品中编号为20-44155的讨论或提问。 在CSDN论坛上,开发者可以发表关于DevExpress产品的观点、发起问题、提供解决方案,以及与其他开发者共同探讨有关DevExpress的开发经验和技巧。 这样的讨论对于那些使用DevExpress产品的开发者来说非常有益。在这个讨论中,开发者可以分享遇到的问题、解决方法和最佳实践,互相学习和启发。同时,DevExpress团队也可以通过参与这样的讨论,了解用户在使用产品过程中的需求和反馈,从而更好地改进产品和提供技术支持。 总之,"devexpress20-44155 csdn"可能是一篇关于DevExpress产品的论坛帖子或讨论串的标题,对于使用DevExpress产品的开发者来说是一个很有价值的资源,可以从中获取到有关产品的信息、技巧和解决方案。 ### 回答2: DevExpress是一个专门开发.NET控件和工具的软件公司。它提供了各种强大、灵活和易于使用的控件,可以帮助开发人员更快速地构建.NET应用程序。 20-44155是DevExpress在其产品中的一个特定问题或bug编号。这个编号用于跟踪、记录和解决在使用DevExpress控件时可能出现的问题或错误。当用户在使用DevExpress控件时遇到问题时,他们可以向DevExpress团队报告这个问题,并提供编号以帮助团队定位并修复问题。 CSDN是中国最大的技术社区之一,也是程序员和开发人员共享技术知识和经验的平台。在CSDN上,用户可以发布技术文章、博客和问题,并与其他开发者交流和讨论。当用户在使用DevExpress控件时遇到问题时,他们可以在CSDN上搜索相关问题,可能会找到与本问题类似的文章或解决方案,这对于解决问题可能会有所帮助。 总的来说,DevExpress是一个专门开发.NET控件和工具的软件公司,20-44155是他们产品中的一个特定问题或bug编号,而CSDN是一个技术社区,用户可以在其中交流和分享技术知识和经验。 ### 回答3: DevExpress20-44155是DevExpress控件库中的一个版本号,它可能是某个特定的版本或修补程序。DevExpress是一个知名的软件开发公司,提供各种开发工具和控件库,方便开发人员创建功能强大的软件应用程序。 在DevExpress控件库中,每个版本都会包含一系列的控件和功能更新,旨在帮助开发人员更高效地构建用户界面和功能模块。这些控件可以用于各种应用程序开发环境,如Windows Forms、ASP.NET、WPF等。 而20-44155则是DevExpress控件库特定版本或修补程序的标识号。通过这个编号,开发人员可以轻松地找到和定位特定的版本或修补程序,以便获取所需的功能和修复程序。 csdn是国内知名的技术社区,提供各种软件开发和技术相关的资源和服务,包括技术文章、论坛、问答等。在csdn上,开发人员可以和其他开发者交流、分享经验和获取技术支持。很多开发者在csdn上分享了对DevExpress控件库的使用心得、教程和问题解答。因此,如果你在使用DevExpress控件库时遇到问题,可以在csdn上搜索相关的文章或提问,获得帮助和解答。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值