Hi,
In Google chrome browser, when user increases grid column size on client side, grid does not re size so it does not show right columns and it does not show horizontal scroll bar as well. I use Telerik.Web.UI.dll released on 02-Apr-2013 version 2013.1.403.35.
HTML page code.
Code behind
Please find attached same sample code without telerik dll.
In Google chrome browser, when user increases grid column size on client side, grid does not re size so it does not show right columns and it does not show horizontal scroll bar as well. I use Telerik.Web.UI.dll released on 02-Apr-2013 version 2013.1.403.35.
HTML page code.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!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
>
<
script
type
=
"text/javascript"
src
=
"http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"
></
script
>
<
script
type
=
"text/javascript"
>
//$(document).ready(SetObject);
$(window).resize(SetRADGrid);
function SetRADGrid() {
var grid = document.getElementById(rdgrdGenericReportClientID);
var windowHeight = $(window).height();
var windowWidth = $(window).width();
var gridHeight = 0;
var contentPageHeight = 510;
var pageHeaderAndFooter = 125;
var gridHeader = 75;
gridHeight = windowHeight - pageHeaderAndFooter <
contentPageHeight
? contentPageHeight - gridHeader : windowHeight - gridHeader - pageHeaderAndFooter;
grid.style.height
=
gridHeight
+ "px";
var
webSiteWidth
=
1024
;
var
submenuWidth
=
231
;
var
gridWidth
=
windowWidth
< webSiteWidth ? webSiteWidth - submenuWidth : windowWidth - submenuWidth;
grid.style.width
=
gridWidth
+ "px";
//grid.repaint();
}
function GridCreating(sender, eventArgs) {
SetRADGrid();
}
function ColumnResized(sender, eventArgs) {
//alert('hi');
SetRADGrid();
}
</script>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
asp:ScriptManager
ID
=
"ScriptManager1"
runat
=
"server"
/>
<
div
>
<
telerik:RadGrid
ID
=
"rdgrdGenericReport"
AllowSorting
=
"True"
runat
=
"server"
GridLines
=
"None"
AllowPaging
=
"True"
PageSize
=
"25"
AllowFilteringByColumn
=
"True"
OnNeedDataSource
=
"rdgrdGenericReport_NeedDataSource"
OnColumnCreated
=
"rdgrdGenericReport_ColumnCreated"
ShowGroupPanel
=
"True"
EnableLinqExpressions
=
"False"
EnableTheming
=
"false"
Style="overflow: hidden;
position: relative">
<
GroupHeaderItemStyle
Font-Bold
=
"True"
/>
<
ClientSettings
Resizing-AllowColumnResize
=
"true"
AllowDragToGroup
=
"True"
>
<
Resizing
AllowColumnResize
=
"True"
ResizeGridOnColumnResize
=
"true"
></
Resizing
>
<
Scrolling
AllowScroll
=
"true"
/>
<
ClientEvents
OnGridCreating
=
"SetRADGrid"
OnColumnResized
=
"SetRADGrid"
/>
</
ClientSettings
>
<
ExportSettings
ExportOnlyData
=
"true"
IgnorePaging
=
"true"
OpenInNewWindow
=
"true"
>
</
ExportSettings
>
<
MasterTableView
ShowHeader
=
"true"
BorderStyle
=
"None"
CommandItemDisplay
=
"Top"
TableLayout
=
"Fixed"
>
<
HeaderStyle
Font-Bold
=
"true"
></
HeaderStyle
>
<
FooterStyle
HorizontalAlign
=
"right"
></
FooterStyle
>
<
CommandItemTemplate
/>
</
MasterTableView
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
/>
</
telerik:RadGrid
>
</
div
>
</
form
>
</
body
>
</
html
>
Code behind
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Page.ClientScript.RegisterStartupScript(this.GetType(), "RADGrid", string.Format("rdgrdGenericReportClientID='{0}';", rdgrdGenericReport.ClientID), true);
}
protected void rdgrdGenericReport_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
BO bo = new BO();
rdgrdGenericReport.DataSource = bo.GetStudent();
}
protected void rdgrdGenericReport_ColumnCreated(object sender, GridColumnCreatedEventArgs e)
{
e.Column.HeaderStyle.Width = Unit.Pixel(100);
}
}
public class BO
{
public List<
Student
> GetStudent()
{
List<
Student
> students = new List<
Student
>();
for (int counter = 1; counter <= 45; counter++)
{
students.Add(new Student(counter.ToString(),
string.Format("Student({0})", counter),
string.Format("Class Name A{0}", counter),
string.Format("Marks 10{0}", counter),
string.Format("Student Rank is {0}", counter)
));
}
return students;
}
}
public class Student
{
public Student(string id, string name, string className, string marks, string rank)
{
ID = id;
Name = name;
ClassName = className;
Marks = marks;
Rank = rank;
}
public string ID { get; set; }
public string Name { get; set; }
public string ClassName { get; set; }
public string Marks { get; set; }
public string Rank { get; set; }
}
Please find attached same sample code without telerik dll.