Hi,
I am having an issue with a RadGrid which appears to only occur in IE9. The issue only occurs if I enable AllowScroll in the client settings. When I mouse over the column headers or click on the horizontal scrollbar what I believe is the outer RadGrid div is growing in size leaving a blank space between the grid contents (and horizontal scroll) and the surrounding border. The grid itself has a two level hierarchy and expanding/collapsing any of the items causes the outer div to resize itself back.
Running IE9 in IE7/IE8 or IE9 compatibility mode does not show the problem. It appears to only occur in IE9 itself.
I also have some css to force the height to auto:
I have found that the problem appears to only occur if I set the Grid width in JS. This is done in the OnGridCreated client event using the following code:
The 140px offset is simply to allow for a page border. The ResizeGrid function is only ever called the once (through the GridCreated function).
Is there another way to set the Grid width that would be better suited? This appears to be the recommended way to do this as per Telerik support (http://www.telerik.com/community/forums/aspnet-ajax/grid/radgrid-width-and-height-in-javascript-dom.aspx)
I have some screen captures showing the issue if that helps? Just let me know how you would like me to get them to you.
Cheers,
Andrew
I am having an issue with a RadGrid which appears to only occur in IE9. The issue only occurs if I enable AllowScroll in the client settings. When I mouse over the column headers or click on the horizontal scrollbar what I believe is the outer RadGrid div is growing in size leaving a blank space between the grid contents (and horizontal scroll) and the surrounding border. The grid itself has a two level hierarchy and expanding/collapsing any of the items causes the outer div to resize itself back.
Running IE9 in IE7/IE8 or IE9 compatibility mode does not show the problem. It appears to only occur in IE9 itself.
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
DataSourceID
=
"ObjectDataSource1"
OnColumnCreated
=
"RadGrid1_ColumnCreated"
OnItemCreated
=
"RadGrid1_ItemCreated"
OnItemDataBound
=
"RadGrid1_ItemDataBound"
OnExportCellFormatting
=
"RadGrid1_ExportCellFormatting"
Width
=
"100%"
>
<
MasterTableView
HierarchyDefaultExpanded
=
"false"
HierarchyLoadMode
=
"Client"
AllowSorting
=
"false"
DataKeyNames
=
"EventGroupTypeId, ParentEventGroupTypeId"
TableLayout
=
"Fixed"
>
<
SelfHierarchySettings
ParentKeyName
=
"ParentEventGroupTypeId"
KeyName
=
"EventGroupTypeId"
/>
</
MasterTableView
>
<
ClientSettings
AllowExpandCollapse
=
"true"
>
<
Scrolling
AllowScroll
=
"true"
/>
<
ClientEvents
OnGridCreated
=
"GridCreated"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
I also have some css to force the height to auto:
.rgDataDiv { height: auto !important }
I have found that the problem appears to only occur if I set the Grid width in JS. This is done in the OnGridCreated client event using the following code:
function GridCreated(sender, args) {
ResizeGrid();
}
function ResizeGrid() {
var grid = $find("<%= RadGrid1.ClientID %>");
grid.get_element().style.width = ($(window).width() - 140) + "px"; // <-- with this line included, the problem shows. Without it, the problem doesn't show but the grid also goes off the screen (large number of columns)
}
The 140px offset is simply to allow for a page border. The ResizeGrid function is only ever called the once (through the GridCreated function).
Is there another way to set the Grid width that would be better suited? This appears to be the recommended way to do this as per Telerik support (http://www.telerik.com/community/forums/aspnet-ajax/grid/radgrid-width-and-height-in-javascript-dom.aspx)
I have some screen captures showing the issue if that helps? Just let me know how you would like me to get them to you.
Cheers,
Andrew