views:

1647

answers:

1

I am trying to add a TextEdit to a column on a DevExpress GridView at runtime, this is what I have got (copied pretty much from some auto-generated designer code).

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

What have I missed? (cos it doesn't work, "Comments" is still just a normal column)

+1  A: 

Using code below I was able to add a TextEdit column to my text field. I didn't need to use the RepositoryItems.Add function.

        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;
Nathan Koop
Ah ha, maybe it needs the name - I'll try that.
kpollock
@kpollock, did this work for you?
Nathan Koop