• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 876
  • Last Modified:

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?

0
strongd
Asked:
strongd
  • 4
  • 3
  • 2
1 Solution
 
DarkoLordCommented:
Do you really have to display the ENTIRE string? Can't you just display let's say, the first 1000 characters or so?
0
 
strongdAuthor Commented:
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.  

0
 
DarkoLordCommented:
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)
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 
strongdAuthor Commented:
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???  
0
 
craskinCommented:
this will create an IE instance with no toolbars and such.

Dim ie
Set ie=createobject("internetexplorer.application")
With ie
    .navigate "about:blank"
    Do Until .readyState=4
     WScript.Sleep 10
    Loop
    .toolbar=0
    .statusbar=0
    .Top=0
    .Left=0
    .Width=ie.document.parentwindow.screen.availWidth
    .Height=ie.document.parentwindow.screen.availHeight
    .navigate "http://cachetweb"
    .visible=true
End With

but i'm curious if any of this is necessary if you say you're only doing this because it stretches out your gridview. can't you just wrap it by setting the width of the column explicitly? <asp:BoundField .... Width="200" />
0
 
craskinCommented:
oh and you'll have to turn on the wrapping on that column, too.
0
 
strongdAuthor Commented:
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.

0
 
craskinCommented:
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.
0
 
strongdAuthor Commented:
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.

0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

  • 4
  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now