If I place the Grid in a table, the horizontal resize fails. If I increase IE window width, the grid resizes properly. If I decrease IE window width, the grid does not resize and IE starts to display an horizontal scrollbar.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TelerikGrid.aspx.cs" Inherits="Application_Test_TelerikGrid" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
html,
body,
form
{
margin:0px;
padding:0px;
height:100%;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<table style="width:100%;height:100%">
<tr>
<td style="height:100%">
<telerik:RadGrid
ID="RadGrid1"
runat="server"
DataSourceID="XmlDataSource1"
AllowPaging="true"
PageSize="40"
Width="100%"
Height="100%"
style="border:0;outline:none"
>
<MasterTableView TableLayout="Auto"/>
<ClientSettings EnableRowHoverStyle="true">
<Selecting AllowRowSelect="true" />
<Scrolling AllowScroll="true" UseStaticHeaders="true" />
</ClientSettings>
<PagerStyle Mode="NextPrevAndNumeric" />
</telerik:RadGrid>
</td>
</tr>
</table>
<asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/datasource.xml" />
</form>
</body>
</html>
If I change <table> by <div> it works properly. I am using 2009.1.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TelerikGrid.aspx.cs" Inherits="Application_Test_TelerikGrid" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<style type="text/css">
html,
body,
form
{
margin:0px;
padding:0px;
height:100%;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div style="width:100%;height:100%">
<telerik:RadGrid
ID="RadGrid1"
runat="server"
DataSourceID="XmlDataSource1"
AllowPaging="true"
PageSize="40"
Width="100%"
Height="100%"
style="border:0;outline:none"
>
<MasterTableView TableLayout="Auto"/>
<ClientSettings EnableRowHoverStyle="true">
<Selecting AllowRowSelect="true" />
<Scrolling AllowScroll="true" UseStaticHeaders="true" />
</ClientSettings>
<PagerStyle Mode="NextPrevAndNumeric" />
</telerik:RadGrid>
</div>
<asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/datasource.xml" />
</form>
</body>
</html>
This is happening on IE 7 and 8. Both code samples work properly on FF 3.0.7.
Thanks


function refreshGrid(arg) {
if (!arg) {
$find(
"<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");
}
else {
$find(
"<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");
}
}
in the vb pages i have the following code:
Protected
Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) Handles RadAjaxManager1.AjaxRequest
If e.Argument = "Rebind" Then
RadGrid1.Rebind()
ElseIf e.Argument = "RebindAndNavigate" Then
RadGrid1.MasterTableView.CurrentPageIndex = RadGrid1.MasterTableView.PageCount
RadGrid1.Rebind()
End If
End Sub
I have set RadAjaxManager1 to update RadGrid1 in the RadAjaxManager but get the error - does anyone have an idea why this happens? The database is being updated and the grid displays the correct data once the page is refreshed.
Many thanks in advance
Steve :o)
| <telerik:RadComboBox ID="cboCities" runat="server" AutoPostBack="True" EnableLoadOnDemand="True" |
| EnableVirtualScrolling="True" Height="200px" MarkFirstMatch="True" |
| OnClientItemsRequesting="OnClientItemsRequesting" |
| OnItemsRequested="cboCities_ItemsRequested" Filter="None" ShowMoreResultsBox="True" |
| Width="240px" Font-Size="X-Small" AllowCustomText="True" |
| EmptyMessage="Type a city name" Skin="Black"> |
| <CollapseAnimation Duration="200" Type="OutQuint" /> |
| </telerik:RadComboBox> |
| function OnClientItemsRequesting(sender,e) |
| { |
| if(sender.get_appendItems()) |
| e.get_context().CustomText=""; |
| else |
| e.get_context().CustomText=sender.get_text(); |
| } |
| Protected Sub cboCities_ItemsRequested(ByVal sender As Object, ByVal e As RadComboBoxItemsRequestedEventArgs) |
| Dim sql As String = "Select cityCode,cityName,State,Lat,Long from s_CityMaster WHERE Cityname LIKE '%" + e.Context("CustomText").ToString() + "%' ORDER BY CityName" |
| Dim adapter As New SqlDataAdapter(sql, ConfigurationManager.AppSettings("BioDiasporaCS")) |
| Dim data As New DataTable() |
| adapter.Fill(data) |
| Try |
| Dim itemsPerRequest As Integer = 10 |
| Dim itemOffset As Integer = e.NumberOfItems |
| Dim endOffset As Integer = itemOffset + itemsPerRequest |
| If endOffset > data.Rows.Count Then |
| endOffset = data.Rows.Count |
| End If |
| If endOffset = data.Rows.Count Then |
| e.EndOfItems = True |
| End If |
| Dim i As Integer = itemOffset |
| While i < endOffset |
| cboCities.Items.Add(New RadComboBoxItem(data.Rows(i)("cityName").ToString(), data.Rows(i)("cityName").ToString())) |
| i = i + 1 |
| End While |
| If data.Rows.Count > 0 Then |
| e.Message = [String].Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset.ToString(), data.Rows.Count.ToString()) |
| Else |
| e.Message = "No matches" |
| End If |
| Catch |
| e.Message = "No matches" |
| End Try |
| End Sub |