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

TextWrap in RadComboBox

6 Answers 157 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
666
Top achievements
Rank 1
666 asked on 08 Oct 2010, 01:03 PM

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


Thanks in advance

6 Answers, 1 is accepted

Sort by
0
Dani
Telerik team
answered on 11 Oct 2010, 07:16 AM
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
0
Jiri
Top achievements
Rank 1
answered on 26 Jan 2015, 03:45 PM
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
0
Masha
Telerik team
answered on 27 Jan 2015, 07:25 AM
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.

 
0
Jiri
Top achievements
Rank 1
answered on 27 Jan 2015, 09:32 AM
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
0
Masha
Telerik team
answered on 27 Jan 2015, 09:53 AM
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.

 
0
Jiri
Top achievements
Rank 1
answered on 27 Jan 2015, 10:52 AM
Hi Masha,

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

Cheers,
Jiri
Tags
ComboBox
Asked by
666
Top achievements
Rank 1
Answers by
Dani
Telerik team
Jiri
Top achievements
Rank 1
Masha
Telerik team
Share this question
or