Is it possible to make the width of the dropped down list of items wider than the xamwebcomboeditor's width?
Hello,
There is not a such public property. However, you can change the control's template in order to specify width of the dropped down list wider than the XamComboEditor's with. Here is an example:
<Border x:Name="RootPopupElement" Height="Auto" MaxHeight="{TemplateBinding MaxDropDownHeight}" HorizontalAlignment="Stretch" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" MinWidth="500">
Regards,
Doychin Dochev
That causes the down arrow button on the right of the XamWebComboEditor to disappear and the dropdown no longer functions.
Strange, it works fine for me.
Could you send me a sample application about your problem ?
Doychin
The app is too big. Here is what I did:
<Style x:Key="TestStyle" TargetType="ig:XamWebComboEditor"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="ig:XamWebComboEditor"> <Border x:Name="RootPopupElement" Height="Auto" MaxHeight="{TemplateBinding MaxDropDownHeight}" HorizontalAlignment="Stretch" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" MinWidth="400"/> </ControlTemplate> </Setter.Value> </Setter> </Style>
<ig:XamWebComboEditor HorizontalAlignment="Left" Margin="372,29,0,0" Name="cboEmployee" VerticalAlignment="Top" Width="236" DisplayMemberPath="Name" Style="{StaticResource TestStyle}">
I realized what your problem is. Probably I should have explained how to change the control's template in more details.
In your sample you rewrite the control's template with one small part of the whole template.
You should rewrite the control's template with the whole control's template and add only one additional property - MinWidth="400".
The easiest way to do this is by using Blend.
1. click with the right button onto your XAML file and chose - Open in Expression Blend (for SL4 you need Blend 4)
2. Right click on the ComboEditor -> Edit Template -> Edit a Copy. The Blend will create a copy of the whole control's template.
3. Just add to the new template - MinWidth="400".
Ok I am making progress. Downloaded and installed blend 4 and created a copy of the combo editor's style. That generated a lot of xaml and I have no idea where to put the minwidth property. Sorry this is my first time working with silverlight/xaml. I am mostly a windows forms developer.
Never Mind! I found it. Works great, thank you!