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

How do I set AutoSizeDropDownToBestFit in a GridView MultiColumnCB?

2 Answers 141 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Hugo Ruivo
Top achievements
Rank 1
Hugo Ruivo asked on 18 Dec 2009, 10:53 AM
Hi,

I have added a new column of type GridViewMultiColumnComboBoxColumn to a GridView, but when I run the application I have this issue thats on this link:
http://img96.imageshack.us/i/image01g.jpg/
which I can't solve by my self. So how do I set autoSizeDropDownToBestFit like on the MultiColumnComboBox object? or something like that.

Regards,
Hugo Ruivo

2 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 18 Dec 2009, 01:48 PM
Hi Hugo Ruivo,

If you want to resize the dropdown according to the columns' width, please set the AutoSizeDropDownToBestFit to true:
void radGridView1_CellBeginEdit(object sender, GridViewCellCancelEventArgs e)
{
    if (this.radGridView1.CurrentColumn is GridViewMultiComboBoxColumn)
    {
        RadMultiColumnComboBoxElement editor = (RadMultiColumnComboBoxElement)this.radGridView1.ActiveEditor;
        editor.AutoSizeDropDownToBestFit = true;
    }
}

Please note that this modification should be done in the CellBeginEdit event as it is demonstrated in this article.

I hope this helps. If you have additional questions, feel free to contact me.

Sincerely yours,
Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Hugo Ruivo
Top achievements
Rank 1
answered on 18 Dec 2009, 02:13 PM
Thank you, It worked.
It looks now much better.

Thanks!
Tags
GridView
Asked by
Hugo Ruivo
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Hugo Ruivo
Top achievements
Rank 1
Share this question
or