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

ComboBoxColumn drop down width

3 Answers 153 Views
GridView
This is a migrated thread and some comments may be shown as answers.
troy
Top achievements
Rank 1
troy asked on 03 Oct 2012, 02:52 PM
I'm looking for a way to set the drop-down width for a ComboBoxCoumn to the same width of the column.

3 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 08 Oct 2012, 12:21 PM
Hello Troy,

You can set a width for the GridViewComboBoxColumn's editor that is RadComboBox like this:

<Style TargetType="telerik:RadComboBoxItem">
    <Setter Property="MaxWidth" Value="130"/>
</Style>

I must say that there is no Width property for the drop-down of the RadComboBox, so I suggest you to use ItemTemplate and Text Wrapping for the ComboBoxColumn. Check this help article which shows you how to use template. Note that there are 4 pixels deviation between drop-down's width and Column's width. For your convenience I have made sample project that shows you the approach. You can find it attached.

All the best,
Yoan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
troy
Top achievements
Rank 1
answered on 08 Oct 2012, 01:11 PM
that would work great if I only had a single combo box.  I have several different combo boxes on this window and I don't want their width limited to what I need for the combo box column.
0
Yoan
Telerik team
answered on 08 Oct 2012, 02:17 PM
Hello,

When you are defining a style, you have two options - to apply it explicitly or implicitly. The first one - explicit - means that you have added a x:Key attribute to the style and use it afterwards as a StaticResource. This style will be applied only to those elements to which you explicitly set it - like in the GridViewComboBoxColumn.

Greetings,
Yoan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
troy
Top achievements
Rank 1
Answers by
Yoan
Telerik team
troy
Top achievements
Rank 1
Share this question
or