Danny Ellis
Top achievements
Rank 1
Danny Ellis
asked on 08 Mar 2010, 02:05 PM
I am fairly new to Silverlight and XAML so this may be an easy question to answer. The RadComboBox seems to be set to 100% width by default - when IsEditable is not set to True. However, when IsEditable IS set to true, it collapses to the size of the entered text and/or the selected item. Is there a way to make it full width all the time?
4 Answers, 1 is accepted
0
Hello Danny,
It depends on the parent element. If it is Grid panel, it will automatically stretch its content, e.g. RadComboBox. Could you post here the XAML which causes RadComboBox to shrink?
Regards,
Valeri Hristov
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.
It depends on the parent element. If it is Grid panel, it will automatically stretch its content, e.g. RadComboBox. Could you post here the XAML which causes RadComboBox to shrink?
Regards,
Valeri Hristov
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.
0
Danny Ellis
Top achievements
Rank 1
answered on 08 Mar 2010, 03:18 PM
If this is not enough, please let me know. You can see here that the parent element is a grid cell. I'm not familiar with the a Grid Panel. Is that different from a grid?
Without changing anything else, simply changing IsEditable from True to False fixes the width problem or conversely from False to True, causes the problem. Thanks in advance.
Without changing anything else, simply changing IsEditable from True to False fixes the width problem or conversely from False to True, causes the problem. Thanks in advance.
<telerikInput:RadComboBox x:Name="SkillComboBox" Grid.Row="0" Grid.Column="0" Margin="1" telerik:TextSearch.TextPath="SkillName" TextSearchMode="Contains" HorizontalAlignment="Left" ItemTemplate="{StaticResource SkillComboBoxCustomTemplate}" IsEditable="True" IsReadOnly="True" ></telerikInput:RadComboBox>
0
Hi Danny,
The HorizontalAlignment=Left makes the RadComboBox to shrink when its content is small. I suppose that the SkillComboBoxItemTemplate has specified Width, or its content has specified dimensions, and it causes the control to retain its size when IsEditable=false. I suppose that if you remove HorizontalAlignment=Left, or replace it with HorizontalAlignment=Stretch the problem will disappear.
Regards,
Valeri Hristov
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.
The HorizontalAlignment=Left makes the RadComboBox to shrink when its content is small. I suppose that the SkillComboBoxItemTemplate has specified Width, or its content has specified dimensions, and it causes the control to retain its size when IsEditable=false. I suppose that if you remove HorizontalAlignment=Left, or replace it with HorizontalAlignment=Stretch the problem will disappear.
Regards,
Valeri Hristov
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.
0
Danny Ellis
Top achievements
Rank 1
answered on 08 Mar 2010, 04:57 PM
Thanks very much. That got it.