PDA

View Full Version : [CLOSED] Paging not working with MasterPage



marco.morreale
Apr 26, 2012, 9:05 AM
Hi,
I'm experiencing thi problem using masterPage.
A simply applied a masterPage to the GridPanel ext.NET Example and I could reproduce the error: paging not working.

.aspx page




<%@ Page Language="C#" MasterPageFile="~/MasterPages/TestMaster.Master" %>

<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Xml.Xsl" %>
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Linq" %>
<%@ Import Namespace="System.Data.SqlClient" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">
protected void Page_Load(object sender, EventArgs e)
{
if (!X.IsAjaxRequest)
{
this.Store1.DataSource = this.GetDataReader();
this.Store1.DataBind();
}
}

private SqlDataReader GetDataReader()
{
SqlConnection myConnection;
SqlCommand myCommand;
SqlDataReader myDataReader;

string strConn = System.Configuration.ConfigurationManager.Connecti onStrings["NorthwindConnectionString"].ConnectionString;

myConnection = new SqlConnection(strConn);
myConnection.Open();

myCommand = new SqlCommand("SELECT * FROM Suppliers", myConnection);
myDataReader = myCommand.ExecuteReader();

return myDataReader;
}

</script>

<asp:Content ID="Customer_List_Content" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

<h1>GridPanel using DataReader with Local Paging and Remote Reloading</h1>

<ext:Store
ID="Store1"
runat="server"
PageSize="10">
<Model>
<ext:Model runat="server">
<Fields>
<ext:ModelField Name="SupplierID" />
<ext:ModelField Name="CompanyName" />
<ext:ModelField Name="ContactName" />
<ext:ModelField Name="ContactTitle" />
</Fields>
</ext:Model>
</Model>
</ext:Store>

<ext:GridPanel
id="GridPanel1"
runat="server"
StoreID="Store1"
Title="DataReader Grid"
Width="600"
Height="320">
<ColumnModel runat="server">
<Columns>
<ext:Column runat="server" Text="Supplier ID" DataIndex="SupplierID" />
<ext:Column runat="server" Text="Company Name" DataIndex="CompanyName" Flex="1" />
<ext:Column runat="server" Text="Contact Name" DataIndex="ContactName" />
<ext:Column runat="server" Text="Contact Title" DataIndex="ContactTitle" />
</Columns>
</ColumnModel>
<SelectionModel>
<ext:RowSelectionModel runat="server" Mode="Multi" />
</SelectionModel>
<BottomBar>
<ext:PagingToolbar runat="server" StoreID="Store1" />
</BottomBar>
</ext:GridPanel>


</asp:Content>




.Master


<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="TestMaster.master.cs" Inherits="renosistemi.it.MasterPages.TestMaster" %>
<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<!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>
</head>

<body>
<form runat="server">
<ext:ResourceManager runat="server" ></ext:ResourceManager>
<div>
<asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

</asp:ContentPlaceHolder>
</div>
</form>
</body>
</html>

Daniil
Apr 26, 2012, 10:38 AM
Hi,

Confirmed. We will fix.

For now I can suggest:

1. Set up

IDMode="Static"
for the Store.

2. Remove

StoreID="Store1"
of the PagingToolbar.

3. Set up

Store="Store1"
for the PagingToolbar.

marco.morreale
Apr 26, 2012, 12:16 PM
Thank you Daniil,
your fix solved.
M

marco.morreale
Apr 26, 2012, 12:35 PM
Sorry Daniil,
pagingToolbar is working apparently but the PanelGrid doesn't refresh on page change (does not load the new page records).
M

Daniil
Apr 26, 2012, 4:35 PM
We are investigating a possible fix.

Daniil
Apr 26, 2012, 6:56 PM
It has been fixed in SVN, please update and re-test.