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

Wrap Text in a RadAutoComplete

1 Answer 231 Views
AutoCompleteBox
This is a migrated thread and some comments may be shown as answers.
Thomas
Top achievements
Rank 1
Thomas asked on 04 Jun 2015, 06:59 PM
We are having an issue where the results are wider than the available area on the RadAutoCompleteBox. If it is too wide, it adds the ellipses (...). We would prefer it wrap. I tried programmatically setting the radAutoCompleteBox.ListItem.TextWrap to true, but there was no effect. How can I make the text in the drop down wrap?

1 Answer, 1 is accepted

Sort by
0
Accepted
Ralitsa
Telerik team
answered on 09 Jun 2015, 08:58 AM
Hi Thomas,

Thank you for contacting us. 

You need to set the AutoSizeItems property to true of RadAutoCompleteBox.ListElement and the TextWrap property to true. Here is а code snippet: 
this.radAutoCompleteBox1.ListElement.AutoSizeItems = true;
RadAutoCompleteBoxListElement le = this.radAutoCompleteBox1.ListElement as RadAutoCompleteBoxListElement;
le.VisualItemFormatting+=le_VisualItemFormatting;
 
//handler of VisualItemFormatting
void le_VisualItemFormatting(object sender, VisualItemFormattingEventArgs args)
{
    args.VisualItem.TextWrap = true;
}

You can also refer to the attached sample demo. 

Hope this will help you. Let me know if you have any other questions.

Regards,
Ralitsa
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
AutoCompleteBox
Asked by
Thomas
Top achievements
Rank 1
Answers by
Ralitsa
Telerik team
Share this question
or