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
  1. Home
  2. Web Development
  3. ASP.NET
  4. Populate dynamic data on mouse hover

Populate dynamic data on mouse hover

Scheduled Pinned Locked Moved ASP.NET
csstutorial
4 Posts 2 Posters 0 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.
  • N Offline
    N Offline
    nainakarri
    wrote on last edited by
    #1

    Hi i am in requirment that, i have a gridview with data binded. different row has different status. on mouse hover of the status in the grid, i want to display a some message based on status of the record, ex: if the rec is at initial stage, on mouse hover it should show all pending status like approval,review,close...... these status should be links. should be able to click on links also. is it possible to give me some code example...... Would be very thank ful if this is sorted out. Regards Naina

    M 1 Reply Last reply
    0
    • N nainakarri

      Hi i am in requirment that, i have a gridview with data binded. different row has different status. on mouse hover of the status in the grid, i want to display a some message based on status of the record, ex: if the rec is at initial stage, on mouse hover it should show all pending status like approval,review,close...... these status should be links. should be able to click on links also. is it possible to give me some code example...... Would be very thank ful if this is sorted out. Regards Naina

      M Offline
      M Offline
      Milind R Chavan
      wrote on last edited by
      #2

      Hi, There are two ways you can do that. 1. If you are using Ajax Updatepannel then, you can easily get info from site http://www.asp.net/AJAX/AjaxControlToolkit/Samples/HoverMenu/HoverMenu.aspx[^] 2. if it is normal Aspx page with no ajax then, on each rowbound write code for mouse hover attribute eg. if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes["onmouseover"] = "this.style.cursor='hand'"; e.Row.Attributes["onmouseout"] = "this.style.textDecoration='none';"; } you can also call javascript on onmouseover attribute. Regards, Milind

      N 1 Reply Last reply
      0
      • M Milind R Chavan

        Hi, There are two ways you can do that. 1. If you are using Ajax Updatepannel then, you can easily get info from site http://www.asp.net/AJAX/AjaxControlToolkit/Samples/HoverMenu/HoverMenu.aspx[^] 2. if it is normal Aspx page with no ajax then, on each rowbound write code for mouse hover attribute eg. if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes["onmouseover"] = "this.style.cursor='hand'"; e.Row.Attributes["onmouseout"] = "this.style.textDecoration='none';"; } you can also call javascript on onmouseover attribute. Regards, Milind

        N Offline
        N Offline
        nainakarri
        wrote on last edited by
        #3

        Thanks for the reply, i have gone through the URL given by u. but the thing is i want to bind ditterent data for different rows. so how can i do that . Naina

        M 1 Reply Last reply
        0
        • N nainakarri

          Thanks for the reply, i have gone through the URL given by u. but the thing is i want to bind ditterent data for different rows. so how can i do that . Naina

          M Offline
          M Offline
          Milind R Chavan
          wrote on last edited by
          #4

          Hi, In that case, you can write a javscript function on onmouseover attribute, and in "Opendiv(para)" javascript method you can pass row index and show the appropriate data in DIV control. protected void gridview_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType == DataControlRowType.DataRow) { e.Row.Attributes["onmouseover"] = "javascript:OpenDiv(" + e.Row.RowIndex + ");"; e.Row.Attributes["onmouseout"] = "javascript:CloseDiv();"; } } Regards, Milind

          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