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

Resize ComboBox

5 Answers 412 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Martin Gleiß
Top achievements
Rank 1
Martin Gleiß asked on 25 Aug 2010, 10:12 AM
Hi,

is it possible to resize the combobox without resizing the column?

More specific: My Grid has a ComboBoxColumn with sometime long text and I want to show in the DropDown the whole text, but in the Grid only a fix width. How can I manage this?

Best Regards

5 Answers, 1 is accepted

Sort by
0
Accepted
Martin Vasilev
Telerik team
answered on 30 Aug 2010, 01:31 PM
Hello Martin Gleiß,

Thank you for writing.

You can set MinSize or Width in the editor's PopupOpened event. Please consider the following code snippet:
void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
{
    RadDropDownListEditor editor = this.radGridView1.ActiveEditor as RadDropDownListEditor;
    if (editor != null)
    {
        RadDropDownListEditorElement editorElement = (RadDropDownListEditorElement)editor.EditorElement;
        editorElement.DropDownSizingMode = SizingMode.RightBottom;
        editorElement.PopupOpened += new EventHandler(editorElement_PopupOpened);
    }
}
void editorElement_PopupOpened(object sender, EventArgs e)
{
    //((RadDropDownListEditorElement)sender).Popup.Width = 300;
    ((RadDropDownListEditorElement)sender).Popup.MinimumSize = new Size(150, 0);
}

I hope this helps. Let me know if you have any additional questions.

Sincerely yours,
Martin Vasilev
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
0
Martin Gleiß
Top achievements
Rank 1
answered on 31 Aug 2010, 12:15 PM
Hi,

which assembly have I to include to use"RadDropDownListEditor"?
0
Accepted
Martin Vasilev
Telerik team
answered on 02 Sep 2010, 05:27 PM
Hello Martin Gleiß,

Thank you for getting back to me.

RadDropDownListEditor is located in the Telerik.WinControls.UI.dll assembly. You should also add the following namespace in your using clauses:
 
using Telerik.WinControls.UI;


Best wishes,
Martin Vasilev
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
0
Trevor
Top achievements
Rank 1
answered on 22 Oct 2010, 11:51 PM
I need to adjust the size of the drop down list on a grid view combo box column, and I am trying the code you have shown here, but I cannot access RadDropDownListEditorElement.  I have no idea what version I am using.  I use telerik controls at work and they already had these controls when I started.  I have using Telerik.WinControls.UI; in my using statements, and am referencing the Telerik.WinControls.UI dll.
0
Martin Vasilev
Telerik team
answered on 27 Oct 2010, 03:55 PM
Hello Trevor,

Thank you for writing.

Recently, we have changed the default combo-box column editor and if you are using an old version, it is possible that you cannot get a RadDropDownListEditor. Please try using RadComboBoxEditor and RadComboBoxEditorElement instead. Still, I recommend upgrading to the latest version Q2 2010 SP2 since it contains a numerous bug fixes and improvements. 

Let me know if you need any additional assistance.

Greetings,
Martin Vasilev
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
Martin Gleiß
Top achievements
Rank 1
Answers by
Martin Vasilev
Telerik team
Martin Gleiß
Top achievements
Rank 1
Trevor
Top achievements
Rank 1
Share this question
or