IsEditable property kills default 100% Width

5 posts, 0 answers
  1. Danny Ellis
    Danny Ellis avatar
    5 posts
    Member since:
    Nov 2005

    Posted 08 Mar 2010 Link to this post

    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? 
  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 08 Mar 2010 Link to this post

    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.
  3. Danny Ellis
    Danny Ellis avatar
    5 posts
    Member since:
    Nov 2005

    Posted 08 Mar 2010 Link to this post

    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. 

     

     

    <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>

     

  4. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 08 Mar 2010 Link to this post

    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.
  5. Danny Ellis
    Danny Ellis avatar
    5 posts
    Member since:
    Nov 2005

    Posted 08 Mar 2010 Link to this post

    Thanks very much.  That got it.
Back to Top