TextWrap in RadComboBox

7 posts, 0 answers
  1. 666
    666 avatar
    17 posts
    Member since:
    Sep 2010

    Posted 08 Oct 2010 Link to this post


    Hi
          I want to wrap a text in radcombox , how to do this


    Thanks in advance
  2. Dani
    Admin
    Dani avatar
    848 posts

    Posted 11 Oct 2010 Link to this post

    Hello Srini,

    Thank you for contacting us.

    Please, check this article which deals with ItemTemplate and SelectionBoxTemplate. You could create an ItemTemplate with anything you would like your combobox item to display, including plain wrapped text, and adjust the appearance further if needed with the SelectionBoxTemplate, which can force the display of only part of the item template.

    Please, note that you may also need to modify the width of the drop down pop-up window to render properly your items if they are too long. You could easily change the width of the drop down using ItemsPanel.

    I hope this information will provide helpful guidance for you.

    Kind regards,
    Dani
    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. DevCraft banner
  4. Jiri
    Jiri avatar
    40 posts
    Member since:
    Oct 2013

    Posted 26 Jan 2015 in reply to Dani Link to this post

    Hi,

    I have similar scenario - I have RadComboBox set with IsEdatable=true and need to be able to write and wrap lines just in editable part not in individual items from the drop down popup, which seems the SelectionBoxTemplate could be appropriate but it doesn't work for me. It seems that it only works when IsEdatable=false.
    So is it possible to make it works somehow?

    Thank you,
    Jiri
  5. Masha
    Admin
    Masha avatar
    355 posts

    Posted 27 Jan 2015 Link to this post

    Hi Jiri,

    With Q2 2014 release of UI for Silverlight we introduced a new TextBoxStyle property of editable RadComboBox which allows you to set directly any properties to the TextBox inside its template. So you just need to change your code like this:

    <telerik:RadComboBox IsEditable="True" Width="120">
        <telerik:RadComboBox.TextBoxStyle>
            <Style TargetType="TextBox">
                <Setter Property="BorderThickness" Value="0"/>
                <Setter Property="BorderBrush" Value="Transparent"/>
                <Setter Property="Background" Value="Transparent"/>
                <Setter Property="TextWrapping" Value="Wrap" />
            </Style>
        </telerik:RadComboBox.TextBoxStyle>
        ...
    </telerik:RadComboBox>

    I hope it helps.

    Regards,
    Masha
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. Jiri
    Jiri avatar
    40 posts
    Member since:
    Oct 2013

    Posted 27 Jan 2015 in reply to Masha Link to this post

    Hi Masha,

    thank you for your prompt answer. I have just tried it, but unfortunately it doesn't work - I am pressing enter and no new rows appears, or I don' t know where else could be a problem. Could you please verify it realy works?

    Thank you,
    Jiri
  7. Masha
    Admin
    Masha avatar
    355 posts

    Posted 27 Jan 2015 Link to this post

    Hello Jiri,

    I've attached the sample project where the approach is demonstrated. Please note you should have set Width property of RadComboBox in order Text to be Wrapped. Also you need to set AcceptsReturn property of TextBox to True in order Enter key to work.

    Hope it helps.

    Regards,
    Masha
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  8. Jiri
    Jiri avatar
    40 posts
    Member since:
    Oct 2013

    Posted 27 Jan 2015 in reply to Masha Link to this post

    Hi Masha,

    Yes, right I forgot on AcceptsReturn, sorry. But thank you for great help service.

    Cheers,
    Jiri
Back to Top
DevCraft banner