Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
633
Screen Jumps on Row Selection
posted

Why does row selection cause the screen to jump to make the top of the grid visible. It only occurs in IE, Google Chrome (and Firefox as well) behaves as expected, making the row selection but keeping the webform in place and not jumping. ASPX and Code Behind to reproduce are below:

 

WebForm1.aspx

 

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication3.WebForm1" %>

<%@ Register Assembly="Infragistics4.Web.v10.2, Version=10.2.20102.1011, Culture=neutral, PublicKeyToken=7dd5c3163f2cd0cb"    Namespace="Infragistics.Web.UI.GridControls" TagPrefix="ig" %>

<!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 runat="server">

    <title></title>

</head>

<body>

    <form id="form1" runat="server">

    <div>

        <asp:ScriptManager ID="ScriptManager1" runat="server">

        </asp:ScriptManager>

        <ig:WebDataGrid ID="WebDataGrid1" runat="server" Width="400px">

            <Behaviors>

                <ig:RowSelectors RowNumbering="True">

                </ig:RowSelectors>

                <ig:Selection CellClickAction="Row" CellSelectType="None" 

                    RowSelectType="Multiple">

                </ig:Selection>

            </Behaviors>

        </ig:WebDataGrid>

    </div>

    </form>

</body>

</html>

WebForms1.aspx.cs
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace WebApplication3
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            DataTable dt = new DataTable();
            dt.Columns.Add("Column1");
            dt.Columns.Add("Column2");
            int counter=0;
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            dt.Rows.Add(new object[] { String.Format("Row {0}", counter++), "Some data" });
            WebDataGrid1.DataSource = dt;
            WebDataGrid1.DataBind();
        }
    }
}