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

Multi-line Combo-box (wrapped when closed)

3 Answers 663 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Jake
Top achievements
Rank 1
Jake asked on 09 Feb 2009, 03:08 PM
Hi,

I'm trying to create a combo box that can wrap the selected item's text when closed. At present, when you set the width of the combo box, the drop-down menu automatically wraps any items that are too wide. However, once you select an item, and the combo box menu closes, the text for the selected item gets cut off if it's wider than the combo box's width. Instead, I want to be able to increase the height of the (closed) combo box and allow the text to wrap.

Is this possible with the RadComboBox? If not, is there another control I could use to achieve this?

Many thanks,

Jake.

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 11 Feb 2009, 11:10 AM
Hi Jake,

I tried to achieve the functionalty, but unfortunately not able to achieve the exact functionality. One suggestion for showing complete slecteditem is by using the Tooltip property to show the complete text which is selected by RadComboBox when mousehover the RadComboBox. The code below shows setting the Tooltip property of RadComboBox to the selecteditem.

ASPX:
<telerik:RadComboBox ID="RadComboBox1" runat="server"  AutoPostBack="true" oWrap="false" Text="Title" onselectedindexchanged="Title_SelectedIndexChanged">  
          <Items>  
              . . . 
          </Items>  
</telerik:RadComboBox>  

CS:
protected void Title_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) 
    RadComboBox1.ToolTip = RadComboBox1.SelectedItem.Text; 

You can also use the RadToolTip control for showing the tooltip.

Thanks,
Shinu.
0
Simon
Telerik team
answered on 11 Feb 2009, 05:10 PM
Hi  Jake,

The text of RadComboBox is displayed in an text input element and this element supports only a single line.

Please consider alternative approaches (as the ToolTip approach, suggested by Shinu).

Sincerely yours,
Simon
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Jake
Top achievements
Rank 1
answered on 11 Feb 2009, 05:32 PM
Thank you both for your replies.

The tool tip is a good idea, but doesn't work in our particular application. Instead, I will have to use a different control. I found the DropDownExtender in the Microsoft AJAX Control Toolkit which seems to be perfect. It allows you to add a custom-made drop-down to ANY control, so in my case I can use a (wrapping) label. (See http://www.asp.net/AJAX/AjaxControlToolkit/Samples/DropDown/DropDown.aspx)

Many thanks,

Jake.
Bhoopathi
Top achievements
Rank 1
commented on 20 Mar 2022, 02:20 PM

I have the same problem in WPF, Any suggestions here other than tooltip?
Tags
ComboBox
Asked by
Jake
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Simon
Telerik team
Jake
Top achievements
Rank 1
Share this question
or