Link to home
Start Free TrialLog in
Avatar of strongd
strongdFlag for United States of America

asked on

GRIDVIEW TOOLTIP acting strange with lots of characters.

I have a web application... I query a db, load the data into a gridview.

One of the fields has a lot of text in it.    When displayed, it stretches out the grid and it looks bad.  
I wrote code to fix this.  If there are more than 33 characters, I replace the text with "Move mouse cursor over to see finding..."  I load the text into tooltip...    The tooltip under that gridview... IE GridView1.Rows(i).Cells(8).ToolTip = GridView1.Rows(i).Cells(8).Text

This works excellent except for when there is a whole lot of text.    Sometimes the text reach over 2000 characters.  When this happens and you drag the mouse over the field "Findings" and it popups up the tooltip but the tooltip starts opening and closing in 1/2 sec intervals.  It is annoying....

This there anything I can do to fix this???   I started looking at ways to customize the tooltip, but it all had to do with actually tooltip class...    I wasn't sure how to customize the gridview tooltip.    

I know tooltip probably wasn't designed to handle a ton of characters, but hopefully there is an easy fix for this.

If not, does anyone have any ideas on others ways to approach this?

Avatar of DarkoLord
DarkoLord
Flag of Slovenia image

Do you really have to display the ENTIRE string? Can't you just display let's say, the first 1000 characters or so?
Avatar of strongd

ASKER

I could, but the problem is that field is very important.  

This table I am querying off is dealing with environmental inspections.  When an organization does very poorly, the finding could be big.  The inspectors sometimes might need to really get down to the detail of their finding so the organizations managers know how to fix the problem before the next inspection.

 How hard is it to popup a small browser window (One with no back or forward buttons, for anything else...).  I am not sure what they are called, but I notice on some sites, you might need info on something and if you click it, some sites will popup a small browser type window with info in it.  I was thinking about trying that, but I don't know what the window is called or how to do it.  

It's not really difficult to open a popup window when you click something. Example with a button:

<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="window.open('http://www.google.com')" />

Instead of Google, you can put any other page there (for example, a custom page to which you pass the ID and it displays the text)
Avatar of strongd

ASKER

How do I customize the window????  I don't want it to be a regular browser with all the button or dropdown menu's...

Just a basic small browser...    Is that possible???  
ASKER CERTIFIED SOLUTION
Avatar of craskin
craskin
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
oh and you'll have to turn on the wrapping on that column, too.
Avatar of strongd

ASKER

craskin:
    How does the wrap work??? I mean, will it show like the first 10 characters??? IE   "Hazard waste was...."  

Then if I click that...it will expand????

I am going to give you the points since you posted on how to control a popup.  

Thanks for your help... also, DarkoLord... I want to thank you to.

wrapping just sends the text that goes beyond your fixed width to the next line so instead of:

this is an incredibly long string to put in a gridview cell

you'd get:

this is an incredibly
long string to put
in a gridview cell.
Avatar of strongd

ASKER

Actually, I have done that wouldn't work, it will make the grid to tall and won't look right.

I think the popup browser is the answer.  


THanks for your help.