Populate dynamic data on mouse hover
-
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
-
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
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
-
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
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
-
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
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