繁体   English   中英

在运行时将TextEdit添加到DevExpress GridView的列中

[英]Adding a TextEdit to a column to a DevExpress GridView at runtime

我正在尝试在运行时将TextEdit添加到DevExpress GridView上的列中,这就是我所得到的(从一些自动生成的设计器代码中复制了很多)。

DevExpress.XtraEditors.Repository.RepositoryItemTextEdit commentTextEdit 
      = new DevExpress.XtraEditors.Repository.RepositoryItemTextEdit();
gvwEnquiryList.Columns["Comments"].ColumnEdit = commentTextEdit;
ctlEnquiryList.RepositoryItems.Add(commentTextEdit);

我错过了什么? (因为它不起作用,“评论”仍然只是普通列)

使用下面的代码,我能够在我的文本字段中添加一个TextEdit列。 我不需要使用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;

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM