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

GridView with combobox

1 Answer 117 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sa
Top achievements
Rank 1
Sa asked on 13 Mar 2012, 07:56 PM
Hi 
i have gridview with a combox column.
My problem is i want to show combobox when the form is loaded.rather empty cell in the whole column of grid.and it gets the shape of 
combo when i double clik on it.
2nd issue is comboxbox got selected on double click.First click enables it and i have to make a 2nd click to drop the list.
I want to show the combobox droped on first click.

Help appreciated.
thnks

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 16 Mar 2012, 02:00 PM
Hello,

Thank you for writing.

Each cell in RadGridView has an editor, which internally consists of controls/elements (combo box in your case). Having this is mind, the control from the cell will not be displayed until the cell editor is opened. When you click a cell, its editor is initialized and only then the control is accessible. So your requirement to show the cell editor prior initializing it is not possible and not recommended since it will have serious performance impact on your application.

In regards to your second requirement, when you click a cell and its editor (in your case combo box) is shown, you can manually call the ShowPopup() method of RadDropDownListEditorElement in order to show the drop down:
void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
    RadDropDownListEditor editor = e.ActiveEditor as RadDropDownListEditor;
    if (editor != null)
    {
        RadDropDownListEditorElement element = editor.EditorElement as RadDropDownListEditorElement;
        element.ShowPopup();
    }
}

I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.
 
Greetings,
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
Sa
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or