This is a migrated thread and some comments may be shown as answers.

Add Combo Box to Specific Cell in the GridView Control

1 Answer 134 Views
GridView
This is a migrated thread and some comments may be shown as answers.
James
Top achievements
Rank 1
James asked on 21 Apr 2012, 04:16 AM
Assume I only want to add a combo box editor to the cell located in the second row, second column of a gridview control.  Am I able to do this?  If so, what code would I use for this?  All of the other cells in this control will have a text edit box editor.


Thanks.




1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 21 Apr 2012, 03:09 PM
Hi James,

Thank you for writing.

A convenient event for replacing the default editor with a custom one is the EditorRequired event of RadGridView. Here is a sample snippet:
void radGridView1_EditorRequired(object sender, EditorRequiredEventArgs e)
{
    if (radGridView1.CurrentCell.RowIndex == 1 && radGridView1.CurrentCell.ColumnIndex == 1)
    {
        e.Editor = new RadDropDownListEditor();
    }
}

More information regarding editors in RadGridView can be found in the following help section: http://www.telerik.com/help/winforms/gridview-editors-using-custom-editors.html.

I hope that you find the provided information useful.

Regards,
Stefan
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
Tags
GridView
Asked by
James
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or