c# - 在运行时将 TextEdit 添加到 DevExpress GridView 的列

标签 c# gridview devexpress

我正在尝试在运行时将 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/

相关文章:

asp.net - Asp.Net WebForms 上的 MVP

php - 使用 Yii2 过滤占位符

c# - Xtra报告 : An object assigned to the DataSource property cannot be used

c# - DevExpress过滤器编辑器: DropdownList

c# - VS2010数据库单元测试继承自ResultSetCondition

c# - 使用 NancyWcfGenericService 运行 Nancy + Mono 时出错

c# - 如何在 umbraco 中获取预值的字符串值

css - 使用 Gridview 并获取可滚动单元格?

c# - 使用正则表达式从 AssemblyInfo.cs 文件中检索程序集版本

asp.net - 免费的第三方 ASP.NET 控件集合?