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

Combobox Width

4 Answers 163 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Susan
Top achievements
Rank 1
Susan asked on 27 Feb 2009, 04:06 PM
Hopefully this is an easy question. In my gridview, I have a combobox column. Though I have the width of the box wide enough to show an item when selected, when the user selects to change the value in the column, the drop downlist is extremely narrow. How do I correct this? I haven't found an option for the column to do this yet.

Susan

4 Answers, 1 is accepted

Sort by
0
Accepted
Deyan
Telerik team
answered on 02 Mar 2009, 03:34 PM
Hello Susan,

Thanks for your question.

You can easily adjust the size of the drop-down of a RadComboBoxCellElement. Consider the following code snippet:

private void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e) 
     RadComboBoxEditor editor = this.radGridView1.ActiveEditor as RadComboBoxEditor; 
     if (editor != null
     { 
         editor.DropDownSizingMode = SizingMode.UpDownAndRightBottom; 
         editor.DropDownMinSize = new Size(400, 400); 
     } 

Please note that you will have to enable the sizing mode of the drop down in order to be able to modify its size.

I hope this will help you achieve the desired behavior.

Do not hesitate to write back in case of further questions.

Regards,
Deyan
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
Susan
Top achievements
Rank 1
answered on 10 Mar 2009, 03:54 PM

Works great. We're using it now.

 

Susan

0
Angus Cheung
Top achievements
Rank 1
answered on 08 Mar 2010, 10:49 AM
I couldn't find the DropDownMinSize in RadComboBoxEditor. I am using WinForms Q3 2009 SP1. Where is it located?

Thanks,
Angus
0
Jack
Telerik team
answered on 09 Mar 2010, 08:40 AM
Hello Angus Cheung,

Actually DropDownMinSize is a property of RadComboBoxEditorElement. Here is the correct code:

void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
{
    RadComboBoxEditor editor = this.radGridView1.ActiveEditor as RadComboBoxEditor;
    if (editor != null)
    {
        editor.DropDownSizingMode = SizingMode.UpDownAndRightBottom;
        ((RadComboBoxEditorElement)editor.EditorElement).DropDownMinSize = new Size(400, 400);
    }
}

If you need further assistance with this, please write back.

Sincerely yours,

Jack
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
Susan
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Susan
Top achievements
Rank 1
Angus Cheung
Top achievements
Rank 1
Jack
Telerik team
Share this question
or