C# 在运行时向DevExpress GridView的列添加文本编辑
我试图在运行时将文本编辑添加到DevExpress GridView上的列中,这就是我得到的(几乎是从一些自动生成的设计器代码中复制的)C# 在运行时向DevExpress GridView的列添加文本编辑,c#,gridview,devexpress,C#,Gridview,Devexpress,我试图在运行时将文本编辑添加到DevExpress GridView上的列中,这就是我得到的(几乎是从一些自动生成的设计器代码中复制的) 我错过了什么?(因为它不起作用,“注释”仍然只是一个普通的列)使用下面的代码,我可以在我的文本字段中添加一个文本编辑列。我不需要使用RepositoryItems.Add函数 DevExpress.XtraEditors.Repository.RepositoryItemTextEdit commentTextEdit = new DevExp
我错过了什么?(因为它不起作用,“注释”仍然只是一个普通的列)使用下面的代码,我可以在我的文本字段中添加一个文本编辑列。我不需要使用RepositoryItems.Add函数
DevExpress.XtraEditors.Repository.RepositoryItemTextEdit commentTextEdit = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
commentTextEdit.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
commentTextEdit.Appearance.Options.UseBackColor = true;
commentTextEdit.Name = "commentTextEdit";
this.comments.ColumnEdit = commentTextEdit;
啊哈,也许它需要名字——我试试看。
DevExpress.XtraEditors.Repository.RepositoryItemTextEdit commentTextEdit = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
commentTextEdit.Appearance.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(128)))), ((int)(((byte)(128)))));
commentTextEdit.Appearance.Options.UseBackColor = true;
commentTextEdit.Name = "commentTextEdit";
this.comments.ColumnEdit = commentTextEdit;