iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hello,
I use webgrid binding to ISDataSource, There are 42 rows,3 pages. The data of first page is display correctly. When I click "next page" button to goto page 2 ,the grid data is not change. When I click "next page" again, the grid data display correctly. When I click "prev page" button to goto page 2,the data is not change too! What's wrong?
You can see the sample by the following url:
http://demo.epoint.com.cn:8080/Website2/Default2.aspx
Please help me !
Thanks!
Hi Xu Guochun,
Please set the property of PagingDataRetrievalMode to ReturnPartialRows in the properties. It should work with your issue. If it won't work, could you give me a simple runable sample so that we could test it here?
Hope it helps.
Regards,
Lili Khiung
The code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %> <%@ Register Assembly="ISNet.WebUI.WebInput" Namespace="ISNet.WebUI.WebControls" TagPrefix="ISWebInput" %> <%@ Register Assembly="ISNet.WebUI.WebDesktop" Namespace="ISNet.WebUI.WebDesktop" TagPrefix="ISWebDesktop" %> <%@ Register Assembly="ISNet.WebUI.ISDataSource, Version=1.0.1500.1, Culture=neutral, PublicKeyToken=c4184ef0d326354b" Namespace="ISNet.WebUI.DataSource" TagPrefix="ISDataSource" %> <%@ Register Assembly="ISNet.WebUI.WebGrid" Namespace="ISNet.WebUI.WebGrid" TagPrefix="ISWebGrid" %> <!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> </head> <body> <form id="form1" runat="server"> <div> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td> </td> <td> 时间: </td> <td align="right" nowrap> <table> <tr> <td> <ISWebInput:WebInput ID="DateFrom1" runat="server"> <CultureInfo CultureName="zh-CN"> </CultureInfo> <DisplayFormat Format="yyyy/MM/dd" IsEnabled="true"> </DisplayFormat> <DateTimeEditor DateInputLink="ctl00_content_DateTo1" IsEnabled="true"> </DateTimeEditor> </ISWebInput:WebInput> </td> <td> 至 </td> <td> <ISWebInput:WebInput ID="DateTo1" runat="server"> <CultureInfo CultureName="zh-CN"> </CultureInfo> <DisplayFormat Format="yyyy/MM/dd" IsEnabled="True"> </DisplayFormat> <DateTimeEditor IsEnabled="true"> </DateTimeEditor> </ISWebInput:WebInput> </td> </tr> </table> </td> <td align="right" nowrap> 标题: </td> <td align="left" nowrap> <asp:TextBox ID="txtTitle" Width="80px" runat="server"></asp:TextBox> </td> <td align="right" nowrap id="tdArchiveS1" runat="server"> 文号: </td> <td align="left" nowrap id="tdArchiveS2" runat="server"> <asp:TextBox ID="txtArchiveNo" Width="80px" runat="server"></asp:TextBox> </td> <td> </td> <td align="left" nowrap> <ISWebDesktop:WebButton ID="btnSearch" runat="server" Text="查 询" PostBackMode="FullPostBack" AutoPostback="true" OnClicked="btnSearch_Clicked" /> </td> </tr> </table> <ISWebGrid:WebGrid ID="GridHandle" runat="server" Width="99%" DefaultStyleMode="Win7" OnInitializeRow="WebGrid1_InitializeRow" UseDefaultStyle="True" DataSourceID="ISDataSource1" DataMember="Messages_Center"> <LayoutSettings PagingMode="ClassicPaging" PagingLoadMode="Custom" PagingSize="20"> </LayoutSettings> <RootTable> <Columns> <ISWebGrid:WebGridColumn Name="RowNumber" Caption="序号" Width="30px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn AllowGrouping="No" AllowSizing="No" AllowSorting="No" Bound="False" ColumnType="CheckBox" EditType="NoEdit" IsRowChecker="True" Name="colChk" ShowInSelectColumns="No" Width="25px"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Name="Title" Caption="主题" DataMember="Title"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Name="BeiZhu" Caption="步骤名称" DataMember="BeiZhu"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Name="TargetDispName" Caption="办理人" DataMember="TargetDispName"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Name="FromDispName" Caption="提交人" DataMember="FromDispName"> </ISWebGrid:WebGridColumn> <ISWebGrid:WebGridColumn Name="GenerateDate" Caption="发送时间" DataMember="GenerateDate"> </ISWebGrid:WebGridColumn> </Columns> </RootTable> </ISWebGrid:WebGrid> <ISDataSource:ISDataSource ID="ISDataSource1" runat="server" SchemaType="CustomObject"> <Tables> <ISDataSource:ISDataSourceTable SelectMethod="WaitHandle_PageView_BanLi" EnablePaging="true" SelectCountMethod="WaitHandle_Count_BanLi" TableName="Messages_Center" TypeName="WebApplication1.App_Code.Messages_Center"> <SelectParameters> <asp:ControlParameter ControlID="DateFrom1" Name="DateFromTo" PropertyName="Value" Type="String" /> <asp:ControlParameter ControlID="DateTo1" Name="DateTo" PropertyName="Value" Type="String" /> <asp:ControlParameter ControlID="txtTitle" Name="txtTitle" PropertyName="Text" Type="String" /> <asp:ControlParameter ControlID="txtArchiveNo" Name="ArchiveNo" PropertyName="Text" Type="String" /> </SelectParameters> </ISDataSource:ISDataSourceTable> </Tables> </ISDataSource:ISDataSource> </div> </form> </body> </html>
using System; using System.Data; using System.Configuration; using System.Web; using System.Web.Security; using System.Web.UI; using Microsoft.Practices.EnterpriseLibrary.Data; namespace WebApplication1.App_Code { [System.ComponentModel.DataObject] public class Messages_Center { [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, false)] public DataView WaitHandle_PageView_BanLi(string DateFromTo, string DateTo, string txtTitle, string ArchiveNo, string sortExpression, int maximumRows, int startRowIndex) { string sql = " where SendMode=4 and IsShow = 1 and IsDel= 0 and IsNoHandle=0 and DoneDate is null "; if (DateFromTo != null && DateFromTo != "") { if (IsOracle()) sql += " and GenerateDate >= TO_DATE('" + DateFromTo + "','YYYY-MM-DD HH24:MI:SS') "; else sql += " and GenerateDate >= '" + DateFromTo + "' "; } if (DateTo != null && DateTo != "") { if (IsOracle()) sql += " and GenerateDate <= TO_DATE('" + DateTo + " 23:59:59','YYYY-MM-DD HH24:MI:SS') "; else sql += " and GenerateDate <= '" + DateTo + " 23:59:59' "; } if (txtTitle != null && txtTitle != "") sql += "and Title like '%" + txtTitle + "%'"; if (ArchiveNo != null && ArchiveNo != "") sql += "and ArchiveNo like '%" + ArchiveNo + "%'"; sql += "and MessageType = '办理' "; string OrderBy = " order by GenerateDate desc "; int TotalNum = 0; DBOperate DBOper = new DBOperate("Northwind_ConnectionString"); DataView dv = DBOper.GetData_Page( " * ", 20, (startRowIndex / 20) + 1, "Messages_Center", "Row_ID", sql, OrderBy, out TotalNum ).DefaultView; return dv; } [System.ComponentModel.DataObjectMethodAttribute(System.ComponentModel.DataObjectMethodType.Select, false)] public int WaitHandle_Count_BanLi(string DateFromTo, string DateTo, string txtTitle, string ArchiveNo, string sortExpression) { string sql = " where SendMode=4 and IsShow = 1 and IsDel= 0 and IsNoHandle=0 and DoneDate is null "; if (DateFromTo != null && DateFromTo != "") { if (IsOracle()) sql += " and GenerateDate >= TO_DATE('" + DateFromTo + "','YYYY-MM-DD HH24:MI:SS') "; else sql += " and GenerateDate >= '" + DateFromTo + "' "; } if (DateTo != null && DateTo != "") { if (IsOracle()) sql += " and GenerateDate <= TO_DATE('" + DateTo + " 23:59:59','YYYY-MM-DD HH24:MI:SS') "; else sql += " and GenerateDate <= '" + DateTo + " 23:59:59' "; } if (txtTitle != null && txtTitle != "") sql += "and Title like '%" + txtTitle + "%'"; if (ArchiveNo != null && ArchiveNo != "") sql += "and ArchiveNo like '%" + ArchiveNo + "%'"; sql += "and MessageType = '办理' "; sql = "Select Count(1) From Messages_Center " + sql; DBOperate DBOper = new DBOperate("Northwind_ConnectionString"); return DBOper.ExecuteSQL_ToInt(sql); } /// <summary> /// 判断当前是否使用的是ORACLE,如果是返回True,否则返回False。如果是Flase,则说明使SQL /// 默认:使用模块框架名称 /// 作者:徐国春 /// 时间:2010-4-8 /// </summary> /// <returns></returns> private Boolean IsOracle() { Database db = DatabaseFactory.CreateDatabase("Northwind_ConnectionString"); if (db.DbProviderFactory.ToString() == "System.Data.OracleClient.OracleClientFactory") return true; else return false; } } }
Have you try to enable the PagingDetectPartialGroupRows property? You can enable it in WebGrid.Designer > Popular Settings > Automatically detect partial grouped rows (for classic paging). Please inform me about the result.
Hi Lili Khiung,
I set the PagingDetectPartialGroupRows property to "true" , but the problem persists.
<ISWebGrid:WebGrid ID="GridHandle" runat="server" Width="99%" DefaultStyleMode="Win7" OnInitializeRow="WebGrid1_InitializeRow" UseDefaultStyle="True" DataSourceID="ISDataSource1" DataMember="Messages_Center"> <LayoutSettings PagingMode="ClassicPaging" PagingLoadMode="Custom" PagingSize="20" PagingDetectPartialGroupRows="true"> </LayoutSettings>
</ISWebGrid:WebGrid>
Now it's Ok!
thanks a lot!
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname