Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Adding a tooltip to a datagrid row

Adding a tooltip to a datagrid row

Scheduled Pinned Locked Moved ASP.NET
javascripthelpquestion
3 Posts 3 Posters 1 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Christer Claesson
    wrote on last edited by
    #1

    Hello there I'm currently working a datagrid and I would like to add a tooltip with an image if you move the rows. The image is bound to an article id that each row has. My idea is something like this: Create a method that gets the specific image url for a given article id. Use e.row.attributes.add to add a javascript that shows the tooltip on mouseover and removes it on mouseout. Will use the method to pass an argument with the image url to the javascrip However, after this I'm stuck. I'm having trouble to get a hold of a nice javascript that can take a image url as argument and show it. And I'm not completely sure if I'm on the right way either, especially as the images need to be different and loaded dymically for each row. Any suggestions what to do?

    N R 2 Replies Last reply
    0
    • C Christer Claesson

      Hello there I'm currently working a datagrid and I would like to add a tooltip with an image if you move the rows. The image is bound to an article id that each row has. My idea is something like this: Create a method that gets the specific image url for a given article id. Use e.row.attributes.add to add a javascript that shows the tooltip on mouseover and removes it on mouseout. Will use the method to pass an argument with the image url to the javascrip However, after this I'm stuck. I'm having trouble to get a hold of a nice javascript that can take a image url as argument and show it. And I'm not completely sure if I'm on the right way either, especially as the images need to be different and loaded dymically for each row. Any suggestions what to do?

      N Offline
      N Offline
      N a v a n e e t h
      wrote on last edited by
      #2

      An easy way could be adding a tags in the row. And give a title for the tag. That will come as tool tip. It could be something like

      1 Reply Last reply
      0
      • C Christer Claesson

        Hello there I'm currently working a datagrid and I would like to add a tooltip with an image if you move the rows. The image is bound to an article id that each row has. My idea is something like this: Create a method that gets the specific image url for a given article id. Use e.row.attributes.add to add a javascript that shows the tooltip on mouseover and removes it on mouseout. Will use the method to pass an argument with the image url to the javascrip However, after this I'm stuck. I'm having trouble to get a hold of a nice javascript that can take a image url as argument and show it. And I'm not completely sure if I'm on the right way either, especially as the images need to be different and loaded dymically for each row. Any suggestions what to do?

        R Offline
        R Offline
        RichardGrimmer
        wrote on last edited by
        #3

        I've just done something similar for the search screens in our web app. Basically on ItemDataBind of the grid, as you say, add an onmouseover handler (no need for a mouseout), pointing to a getImage() javascript function, and in the markup, add a div absolutely positioned, with an img tag inside it. The js function uses ajax to get the url of the associated image (well, actually, it streams it back, but you get the idea). Once I have the image (or the url), it's then a simple matter to set display:inline on the div and src= on the image....

        "Knock me down, I'll get straight back up again, I'll come back stronger than a powered up pacman" (Lilly Allen / Kaiser Chiefs)

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups