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

[Solved] Tooltip for overflow text in grid

3 Answers 498 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Howard
Top achievements
Rank 1
Howard asked on 05 Dec 2011, 12:31 AM
Hi,

Need help for overflow text in grid.

How can i fixed the row of grid for 3 lines text for each row

 when the word in row is longer than  3 lines i want to show as "... " (three dots)

But when mouse is pointed on the line "..." needs to show that hidden content.

3 Answers, 1 is accepted

Sort by
0
Dimo
Telerik team
answered on 05 Dec 2011, 03:29 PM
Hello Niroj,

Since the Grid does not provide any of the described functionality out-of-the-box, you will need to implement it manually and add an appropriate Grid column template.

For easier start, you can do this outside the Grid first.

1. Use two nested <div>s. The outer should have a fixed height style (or max-height) and overflow:hidden applied.

2. When the page loads, you can check whether the inner <div> is higher than the outer <div>, which means you need the dots (ellipsis).

3. The ellipsis can be an absolutely positioned element with dots or an image inside. Attach a mouseover handler to it, and display the tooltip in this handler. If the ellipsis is absolutely positioned, then the outer <div> should be relatively positioned.

4. When using this implementation in the Grid, you will attach the mouseover handlers in the Grid's OnLoad event if using server binding, and the OnDataBound event if using client binding.

The Grid template demos are available at:

http://demos.telerik.com/aspnet-mvc/grid/templatesserverside

http://demos.telerik.com/aspnet-mvc/grid/templatesclientside

Best wishes,
Dimo
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Howard
Top achievements
Rank 1
answered on 09 Dec 2011, 01:13 AM
Hi Dimo,

Is there any sample example for this property?

Thank you
0
Dimo
Telerik team
answered on 09 Dec 2011, 09:06 AM
Hello Niroj,

I am afraid I do not have an example for the described functionality, as it is not related to the Grid component. Let me know if anything specific is unclear in my previous reply.

Regards,
Dimo
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
Tags
Grid
Asked by
Howard
Top achievements
Rank 1
Answers by
Dimo
Telerik team
Howard
Top achievements
Rank 1
Share this question
or