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

GridViewComboBoxColumn ShowDropDown / ShowPopUp

4 Answers 158 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Ryan
Top achievements
Rank 1
Ryan asked on 10 Dec 2008, 12:05 AM

I have a 

 

GridViewComboBoxColumn

 

in a radgridview. Could someone suggest to me how I could force the combobox column to show its drop down when a row is added?

Ryan

4 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 10 Dec 2008, 01:47 PM
Hi Ryan,

Thank you for the question.

In order to achieve the desired behavior, you should first set the current cell, call RadGridView.BeginEdit() and then call ShowPopup() of the ActiveEditor, if this editor is RadComboBoxEditor:
private void SetCurrentCellAndShowPopup()  
{  
    this.radGridView1.Rows[this.radGridView1.Rows.Count - 1].IsCurrent = true;  
    this.radGridView1.Columns[6].IsCurrent = true;  
    this.radGridView1.BeginEdit();  
 
    if (this.radGridView1.ActiveEditor is RadComboBoxEditor)  
    {  
        ((RadComboBoxEditor)this.radGridView1.ActiveEditor).ShowPopup();  
    }  

I have prepared a sample project to demonstrate the above code snippet. If you have additional questions, feel free to contact me.

Best wishes,
Nikolay
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Phil
Top achievements
Rank 1
answered on 15 Jul 2009, 06:57 PM
HI Nikolay

This does not work anymore in Q2 2009 701. Any suggestions for a fix?

Thanks
Reference:
((RadComboBoxEditor)this.radGridView1.ActiveEditor).ShowPopup();  
0
Jack
Telerik team
answered on 16 Jul 2009, 04:46 PM
Hello Phil,

We did a major revamp of our editor system in the last release. This caused some breaking changes, which we have described in the release notes. Basically, you should use the EditorElement property of RadComboBoxEditor. Here is the code:

private void SetCurrentCellAndShowPopup() 
    this.radGridView1.Rows[this.radGridView1.Rows.Count - 1].IsCurrent = true
    this.radGridView1.Columns[6].IsCurrent = true
    this.radGridView1.BeginEdit(); 
 
    RadComboBoxEditor editor = this.radGridView1.ActiveEditor as RadComboBoxEditor; 
    if (editor != null
    { 
        RadComboBoxElement element = (RadComboBoxElement)editor.EditorElement; 
        element.ShowPopup(); 
    } 

I hope this helps. If you have more questions, please write us.

Regards,
Jack
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Phil
Top achievements
Rank 1
answered on 17 Jul 2009, 03:04 AM
Thanks Jack, missed that in the notes
Tags
GridView
Asked by
Ryan
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Phil
Top achievements
Rank 1
Jack
Telerik team
Share this question
or