This is a migrated thread and some comments may be shown as answers.

Scrolling Issue with Opera

3 Answers 51 Views
Grid
This is a migrated thread and some comments may be shown as answers.
s
Top achievements
Rank 1
s asked on 06 May 2011, 06:09 PM
I have a page with horizontal scrolling.  The page has either one or two frozen columns along with an arbitrary number of other columns.  The page renders fine in FF, IE, and Chrome.  In Opera, however, I have a scrolling problem.  When I scroll, half of the non-frozen columns stay in place.  The other non-frozen columns get bunched up like a sock pushed down to the ankle.  Is this a bug in Opera? Am I doing something wrong?

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 09 May 2011, 01:44 PM
Hello,

I am afraid that the provided information is still not sufficient to reproduce the problem. Could you paste the markup for the problematic control? You can also try our online example to see if you can replicate the issue there.

Kind regards,
Pavlina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
s
Top achievements
Rank 1
answered on 09 May 2011, 11:27 PM
This code replicates the problem.
<%@ Page language="c#" Codebehind="Scratch.aspx.cs" MasterPageFile="~/App_MasterPages/layout.Master"
AutoEventWireup="false" Inherits="mojoPortal.Web.UI.Pages.Scratch" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<asp:Content ContentPlaceHolderID="mainContent" ID="MPContent" runat="server">
    <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="false" GridLines="None"
        PageSize="25" AllowSorting="True"  OnPreRender="Data_onItemPreRender">
    </telerik:RadGrid
</asp:Content>

Here is the code behind:
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Globalization;
using System.Web.UI.WebControls;
using System.Data;
using Telerik.Web.UI;
using System.IO;
 
namespace mojoPortal.Web.UI.Pages
{
 
    public partial class Scratch : mojoBasePage
    {    
        override protected void OnInit(EventArgs e)
        {
            base.OnInit(e);
            this.Load += new EventHandler(this.Page_Load);
        }
 
        private void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                CreateDataTable();
            }
        }
 
        // create table, table columns, and table rows
        private void CreateDataTable()
        {
            DataTable table = new DataTable("Product");
 
            DataColumn column0 = new DataColumn();
            column0.DataType = System.Type.GetType("System.String");
            column0.AllowDBNull = false;
            column0.Caption = "A";
            column0.ColumnName = "A";
            column0.DefaultValue = "null";
            table.Columns.Add(column0);
 
            DataColumn column1 = new DataColumn();
            column1.DataType = System.Type.GetType("System.String");
            column1.AllowDBNull = false;
            column1.Caption = "B";
            column1.ColumnName = "B";
            column1.DefaultValue = "null";
            table.Columns.Add(column1);
 
 
            for( int h = 0; h < 35; h++)
            {
                DataColumn column = new DataColumn();
                column.DataType = System.Type.GetType("System.String");
                column.AllowDBNull = true;
                column.Caption = h.ToString();
                column.ColumnName = h.ToString();
                table.Columns.Add(column);
            }
 
            DataColumn column2 = new DataColumn();
            column2.DataType = System.Type.GetType("System.String");
            column2.AllowDBNull = true;
            column2.Caption = "C";
            column2.ColumnName = "C";
            table.Columns.Add(column2);
 
            DataRow row; 
            for (int i = 0; i < 15; i++)
            {
                row = table.NewRow();
                row[0] = i.ToString();
                table.Rows.Add(row);           
            }
 
            RadGrid1.DataSource = table;
            RadGrid1.MasterTableView.HeaderStyle.Height = 150;
            RadGrid1.MasterTableView.HeaderStyle.BorderWidth = 0;
            RadGrid1.MasterTableView.BackColor = System.Drawing.Color.White;       
            RadGrid1.ClientSettings.Scrolling.AllowScroll = true;
            RadGrid1.AllowSorting = false;
            RadGrid1.ClientSettings.Scrolling.ScrollHeight = 420;
            RadGrid1.ClientSettings.Scrolling.UseStaticHeaders = true;
            RadGrid1.ClientSettings.Scrolling.FrozenColumnsCount = 2;
            RadGrid1.DataBind();
        }
 
        protected void Data_onItemPreRender(object sender, EventArgs e)
        {
            GridColumn gridColUserName = RadGrid1.MasterTableView.GetColumn("A");
            gridColUserName.HeaderStyle.Width = Unit.Pixel(160);
 
            GridColumn gridColManage = RadGrid1.MasterTableView.GetColumn("B");
            gridColManage.HeaderStyle.Width = Unit.Pixel(60);
 
            for( int h = 0; h<35; h++)
            {
                GridColumn gridCol1 = RadGrid1.MasterTableView.GetColumn(h.ToString());
                gridCol1.HeaderStyle.Width = Unit.Pixel(30);
            }
 
            GridColumn gridColDummyCol = RadGrid1.MasterTableView.GetColumn("C");
            gridColDummyCol.HeaderStyle.Width = Unit.Pixel(160);
            gridColDummyCol.HeaderStyle.Font.Size = 0;
            RadGrid1.DataBind();
        }
 
    }
}

0
Pavlina
Telerik team
answered on 13 May 2011, 10:16 AM
Hello,

Note that when the structure of the RadGrid control is declared in Page_Load event handler the columns and should be added to the corresponding collection first, before the values for their properties are set. This is important because no ViewState is managed for the object before it has been added to the corresponding collection.

Therefore, I suggest you modify your code and use the logic presented inthis documentation article and let me know if the describe problem in Opera still persists.

All the best,
Pavlina
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Grid
Asked by
s
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
s
Top achievements
Rank 1
Share this question
or