Completed
Last Updated: 12 Jul 2017 06:02 by ADMIN
ADMIN
Jack
Created on: 16 Nov 2011 03:40
Category: MultiColumnCombo
Type: Bug Report
1
FIX. RadGridView - there is no way to adjust the popup size automatically when using GridViewMultiComboBoxColumn
1. Create a project with RadGridView
2. Add a GridViewMultiComboBoxColumn
3. Attach to CellEditorInitialized event and try to handle PopupOpened event to change the popup size.
1 comment
ADMIN
Ralitsa
Posted on: 12 Jul 2017 06:01
When you set the AutoSizeDropDownToBestFit property to true, the column's width will be sized according to its content. The code snippet below demonstrates how can achieve it: 
void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{ 
    var editor = e.ActiveEditor as RadMultiColumnComboBoxElement;
    if (editor != null)
    {
        editor.AutoSizeDropDownToBestFit = true;
    }
}

Another way is changing the MultiColumnPopupForm`s size: 
void radGridView1_CellEditorInitialized(object sender, GridViewCellEventArgs e)
{
    var editor = e.ActiveEditor as RadMultiColumnComboBoxElement;
    if (editor != null)
    {
        editor.PopupOpening -= editor_PopupOpening;
        editor.PopupOpening += editor_PopupOpening;
    }
}

void editor_PopupOpening(object sender, CancelEventArgs e)
{
    if (sender is RadMultiColumnComboBoxElement)
    {
        RadMultiColumnComboBoxElement el = sender as RadMultiColumnComboBoxElement;
        el.MultiColumnPopupForm.Size = new Size(350, 150);
    }
}