How to show text-overflowed items in Comobox with virtualization

1 Answer 47 Views
ComboBox DropDownList
Jie
Top achievements
Rank 3
Iron
Iron
Iron
Jie asked on 07 Aug 2023, 04:40 PM

Hi,

When a combobox has virtualization enabled. If an item's text is too long, instead of wrapping the line, it is now showing ellipsis. I am guessing it wants to keep a fixed height for every item for virtualization purpose. Is there a way to show the full text if its overflowed? For example, show a tooltip when mouse over the item?

 

Thanks,

Jie

1 Answer, 1 is accepted

Sort by
0
Accepted
Konstantin Dikov
Telerik team
answered on 08 Aug 2023, 02:36 PM

Hello Jie,

You can add custom item rendering and set a "title" attribute to a DIV or SPAN element, so that it can display the text that you want. You can also wrap the ComboBox in a Tooltip component, so that it will show stylized tooltip. Following is an example demonstrating this approach:

Hope this helps.

 

Regards,
Konstantin Dikov
Progress Telerik

Stay tuned by visiting our public roadmap and feedback portal pages! Or perhaps, if you are new to our Kendo family, check out our getting started resources!

Jie
Top achievements
Rank 3
Iron
Iron
Iron
commented on 08 Aug 2023, 02:51 PM

Thanks for the example. I am curious if there is any other ways to show the full text without using tooltips.
Konstantin Dikov
Telerik team
commented on 10 Aug 2023, 12:19 PM

Hello,

Displaying the tooltips might be the best option for this particular requirement, since rendering items with different height might cause problems with the virtualization. Nevertheless, I have tested rendering the text on multiple lines and the virtualization seems to work as expected:

Here is the example with the virtual scrolling and the custom rendering of the items:

If you have further questions, please feel free to get back to us.

Tags
ComboBox DropDownList
Asked by
Jie
Top achievements
Rank 3
Iron
Iron
Iron
Answers by
Konstantin Dikov
Telerik team
Share this question
or