2009-04-28 12 views
2

実行時にDevExpress GridViewの列にTextEditを追加しようとしていますが、これは私が得たものです(自動生成されたデザイナーコードからほとんどコピーされています) 。実行時にDevExpress GridViewに列にTextEditを追加する

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

何が欠けていますか? (これは機能しないので、「コメント」はまだまだ普通の列です)

答えて

1

以下のコードを使用して、テキストフィールドに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; 
+0

ああ、多分それは名前が必要です - 私はそれを試みます。 – kpollock

+0

@kpollock、これはあなたのために機能しましたか? –

関連する問題