2009-04-28 6 views
2

J'essaye d'ajouter un TextEdit à une colonne sur un DevExpress GridView à l'exécution, c'est ce que j'ai obtenu (copié à peu près du code de concepteur généré automatiquement) .Ajout d'un TextEdit à une colonne à un DevExpress GridView à l'exécution

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

Qu'est-ce que j'ai manqué? (car cela ne fonctionne pas, "Commentaires" est toujours juste une colonne normale)

Répondre

1

En utilisant le code ci-dessous j'ai été en mesure d'ajouter une colonne TextEdit à mon champ de texte. Je n'avais pas besoin d'utiliser la fonction 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

Ah ah, peut-être qu'il a besoin du nom - je vais essayer ça. – kpollock

+0

@kpollock, cela a-t-il marché pour vous? –

Questions connexes