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

RadGridView ComboBox Size

1 Answer 50 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Fransiscus Setiawan
Top achievements
Rank 1
Fransiscus Setiawan asked on 05 Aug 2010, 09:24 AM
Hi All,

I'm wondering is there any property such as MaxWidthProperty when you press the drop down menu?because what's happening is when the user is scrolling through the drop down, the size is changing while you are scrolling based on the size of the item. I would like to make it fixed. I've tried to use ItemsPanelProperty but it was unsuccessful. I really need to setup the style from the code behind since my column is generated dynamically

<UserControl.Resources>
        <ItemsPanelTemplate x:Key="BusinessLookUpTemplate">
            <StackPanel Orientation="Vertical" MinWidth="100" MaxWidth="100" />
        </ItemsPanelTemplate>
</UserControl.Resources>

And this is how i do it from code behind

Dim colBusinessSource As GridViewComboBoxColumn = CType(dgResults.Columns(e.Result.ColumnName), GridViewComboBoxColumn)
             
colBusinessSource.CellStyle = New Style() With {.TargetType = GetType(RadComboBox)}
 
colBusinessSource.CellStye.Setters.Add(New Setter(RadComboBox.ItemsPanelProperty,                                                  CType(Resources("BusinessLookUpTemplate"), ItemsPanelTemplate)))

Cheers

1 Answer, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 10 Aug 2010, 02:11 PM
Hi Fransiscus Setiawan,

The GridViewComboBoxColumn has the EditorStyle property.
You need to create a style with targettype RadComboBox.
The style should have a setter for the MaxWidth property with the desired value.

Let me know if you meet troubles implementing this approach.

Regards,
Pavel Pavlov
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
Fransiscus Setiawan
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Share this question
or