Are there any good sample snippets of how to use the MouseOver client-side event of the WebDataGrid?
My problem is I am trying to gain access to the row being hovered over and do some action based on that. how do I gain access to the row being hovered over?
On another note, what tool can i use to see the sender and eventArgs properties/methods available. You never realize how much you need intellisense until it's not there!?
Sample code for other Mouse events would help too... Thanks.
Hi Scott,
You can have a look at the documentation about WebDataGrid client side events here.
Or just look at this sample.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="Default" %>
<%@ Register tagprefix="ig" namespace="Infragistics.Web.UI.GridControls" Assembly="Infragistics4.Web.v10.3, Version=10.3.20103.1, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<script type="text/javascript">
function myFunc(sender, args)
{
if(args.get_type() == "row")
var index = args.get_item().get_index();
alert("You hovered over row " + index);
}
</script>
<ig:WebDataGrid ID="iggv" runat="server" AutoGenerateColumns="true" Width="400px" Height="400px">
<ClientEvents MouseOver="myFunc" />
</ig:WebDataGrid>
</form>
</body>
</html>
Hope this helps
Expanding on the sample code you provided, how can I affect the style of each row, such as the code below, which currently throws an error saying [Microsoft JScript runtime error: Object doesn't support this property or method].... see code below:
function WebDataGrid1_Grid_MouseOver(sender, eventArgs)
if (eventArgs.get_type() == "row") {
eventArgs.get_type().get_element().setAttribute("style", "font-weight: bold");
function WebDataGrid1_Grid_MouseOut(sender, eventArgs)
eventArgs.get_type().get_element().setAttribute("style", "font-weight: normal");
Thanks, that looks like exactly what I was looking for.
What tool can i use to see the sender and eventArgs properties/methods available. You never realize how much you need intellisense until it's not there!?
Such as where can I find out that there was a get_item() method off of args.
And furthermore, how would I find out that get_item() had a get_index() method??
Thanks,