[英]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.