我正在尝试在运行时将 TextEdit 添加到 DevExpress GridView 上的列,这就是我得到的(几乎从一些自动生成的设计器代码中复制)。
DevExpress.XtraEditors.Repository.RepositoryItemTextEdit commentTextEdit
= new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
gvwEnquiryList.Columns["Comments"].ColumnEdit = commentTextEdit;
ctlEnquiryList.RepositoryItems.Add(commentTextEdit);
我错过了什么? (因为它不起作用,“评论”仍然只是一个普通的列)
最佳答案
使用下面的代码,我能够将 TextEdit 列添加到我的文本字段中。我不需要使用 Repository Items.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;
关于c# - 在运行时将 TextEdit 添加到 DevExpress GridView 的列,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/796932/