Rank: Newbie Groups: Member
Joined: 7/6/2011 Posts: 5
|
i have a grid running mode set to callback mode, allow paging is true, page size is 20. i have 26 records in my datasource, so i have 2pages on my grid. when i click on the second page it does not load the second page with 6records on internet explorer9. But it worked fine on mozilla firefox. Below is my code snippet. what could be the problem?
Code: HTML/ASPX
[left]<eo:Grid runat="server" ID="condRptGrid" BorderColor="#C7D1DF"
BorderWidth="1px" ColumnHeaderAscImage="00050303" ColumnHeaderDescImage="00050304" ColumnHeaderDividerImage="00050302"
AllowPaging="True" RunningMode="Callback"
OnPageIndexChanged="condRptGrid_PageIndexChanged"
FixedColumnCount="1" Font-Bold="False" Font-Italic="False" Font-Names="Verdana"
Font-Overline="False" Font-Size="9pt" Font-Strikeout="False"
Font-Underline="False" GridLineColor="199, 209, 223" GridLines="Both"
Height="200px" ItemHeight="19" Width="100%" ColumnHeaderHeight="19"
style="margin-right: 107px" >
<FooterStyle CssText="padding-bottom:4px;padding-left:4px;padding-right:4px;padding-top:4px;" />
<ColumnTemplates>
<eo:TextBoxColumn>
<TextBoxStyle CssText="BORDER-RIGHT: #7f9db9 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7f9db9 1px solid; PADDING-LEFT: 2px; FONT-SIZE: 8.75pt; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #7f9db9 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #7f9db9 1px solid; FONT-FAMILY: Tahoma" />
</eo:TextBoxColumn>
<eo:DateTimeColumn>
<DatePicker runat="server" ControlSkinID="None" DayCellHeight="16" DayCellWidth="19"
DayHeaderFormat="FirstLetter" DisabledDates="" OtherMonthDayVisible="True"
SelectedDates="" TitleLeftArrowImageUrl="DefaultSubMenuIconRTL"
TitleRightArrowImageUrl="DefaultSubMenuIcon">
<TodayStyle CssText="font-family: tahoma; font-size: 12px; border-right: #bb5503 1px solid; border-top: #bb5503 1px solid; border-left: #bb5503 1px solid; border-bottom: #bb5503 1px solid" />
<SelectedDayStyle CssText="font-family: tahoma; font-size: 12px; background-color: #fbe694; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
<DisabledDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
<PickerStyle CssText="border-bottom-color:#7f9db9;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#7f9db9;border-left-style:solid;border-left-width:1px;border-right-color:#7f9db9;border-right-style:solid;border-right-width:1px;border-top-color:#7f9db9;border-top-style:solid;border-top-width:1px;font-family:Courier New;font-size:8pt;margin-bottom:0px;margin-left:0px;margin-right:0px;margin-top:0px;padding-bottom:1px;padding-left:2px;padding-right:2px;padding-top:2px;" />
<CalendarStyle CssText="background-color: white; border-right: #7f9db9 1px solid; padding-right: 4px; border-top: #7f9db9 1px solid; padding-left: 4px; font-size: 9px; padding-bottom: 4px; border-left: #7f9db9 1px solid; padding-top: 4px; border-bottom: #7f9db9 1px solid; font-family: tahoma" />
<TitleArrowStyle CssText="cursor:hand" />
<DayHoverStyle CssText="font-family: tahoma; font-size: 12px; border-right: #fbe694 1px solid; border-top: #fbe694 1px solid; border-left: #fbe694 1px solid; border-bottom: #fbe694 1px solid" />
<MonthStyle CssText="font-family: tahoma; font-size: 12px; margin-left: 14px; cursor: hand; margin-right: 14px" />
<TitleStyle CssText="background-color:#9ebef5;font-family:Tahoma;font-size:12px;padding-bottom:2px;padding-left:6px;padding-right:6px;padding-top:2px;" />
<OtherMonthDayStyle CssText="font-family: tahoma; font-size: 12px; color: gray; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
<DayHeaderStyle CssText="font-family: tahoma; font-size: 12px; border-bottom: #aca899 1px solid" />
<DayStyle CssText="font-family: tahoma; font-size: 12px; border-right: white 1px solid; border-top: white 1px solid; border-left: white 1px solid; border-bottom: white 1px solid" />
</DatePicker>
</eo:DateTimeColumn>
<eo:MaskedEditColumn>
<MaskedEdit ControlSkinID="None"
TextBoxStyle-CssText="BORDER-RIGHT: #7f9db9 1px solid; PADDING-RIGHT: 2px; BORDER-TOP: #7f9db9 1px solid; PADDING-LEFT: 2px; PADDING-BOTTOM: 1px; MARGIN: 0px; BORDER-LEFT: #7f9db9 1px solid; PADDING-TOP: 2px; BORDER-BOTTOM: #7f9db9 1px solid; font-family:Courier New;font-size:8pt;">
</MaskedEdit>
</eo:MaskedEditColumn>
</ColumnTemplates>
<ColumnHeaderStyle CssText="background-image:url('00050301');padding-left:8px;padding-top:2px;font-weight: bold;color:white;" />
<ItemStyles>
<eo:GridItemStyleSet>
<ItemStyle CssText="background-color: white" />
<ItemHoverStyle CssText="background-image: url(00050206); background-repeat: repeat-x" />
<SelectedStyle CssText="background-image: url(00050207); background-repeat: repeat-x" />
<CellStyle CssText="padding-left:8px;padding-top:2px; color:#336699;white-space:nowrap;" />
</eo:GridItemStyleSet>
</ItemStyles>
<ContentPaneStyle CssText="border-bottom-color:#7f9db9;border-bottom-style:solid;border-bottom-width:1px;border-left-color:#7f9db9;border-left-style:solid;border-left-width:1px;border-right-color:#7f9db9;border-right-style:solid;border-right-width:1px;border-top-color:#7f9db9;border-top-style:solid;border-top-width:1px;"></ContentPaneStyle>
<Columns>
<eo:RowNumberColumn Width="40" ></eo:RowNumberColumn>
<eo:StaticColumn DataField="SITE_ID" AllowResize="true" HeaderText="Site"></eo:StaticColumn>
<eo:StaticColumn DataField="CURRENT_DT" HeaderText="Date" DataType="DateTime"></eo:StaticColumn>
<eo:StaticColumn DataField="HIGH_WATER" HeaderText="High Water"></eo:StaticColumn>
<eo:StaticColumn DataField="PING_STATUS" HeaderText="Ping Status"></eo:StaticColumn>
<eo:StaticColumn DataField="SUMP_ALARM" HeaderText="Sump Alarm"></eo:StaticColumn>
<eo:StaticColumn DataField="FILTER_CHANGE1" HeaderText="Filter Change1"
Width="120"></eo:StaticColumn>
<eo:StaticColumn DataField="FILTER_CHANGE2" HeaderText="Filter Change2"
Width="120"></eo:StaticColumn>
<eo:StaticColumn DataField="WATER_VOL" HeaderText="Water Vol."></eo:StaticColumn>
<eo:StaticColumn DataField="CUM_WATER_VOL"
HeaderText="Cumm. Water Vol." Width="130"></eo:StaticColumn>
</Columns>
</eo:Grid>[/left]
Code: C#
protected void Page_Load(object sender, EventArgs e)
{
etsb = new EasyTrackServiceBus();
connect = new DbConnect();
user = (User)Session["user"];
customer = user.ClientId;
string query = "SELECT TOP {0} EQUIP_ID,SITE_ID,CONVERT(VARCHAR(26), CURRENT_DT, 100) CURRENT_DT,SUMP_ALARM ,HIGH_WATER,LOW_WATER," +
"FILTER_CHANGE1 ,FILTER_CHANGE2,BACKUP_BATTERY,PING_STATUS,WATER_VOL," +
"CUM_WATER_VOL FROM SYSTEM_CONDITION WHERE SITE_ID IN " +
"(SELECT SITE_ID FROM SITE WHERE CUSTOMER_ID='" + customer + "')";
Session.Add("pgLoadQry", query);
if (!IsPostBack)
{
DataTable custSites = etsb.findCustSite(customer);
Session.Add("custSites", custSites);
populateSiteId(custSites, siteId1);
populateEquipId(custSites, equipId);
}
if (!condRptGrid.IsCallbackByMe)
{
Session.Add("PagingQuery", query);
populateCondRptGrid(query);
}
}
protected void condRptGrid_PageIndexChanged(object sender, System.EventArgs e)
{
populateCondRptGrid((string)Session["PagingQuery"]);
}
public void populateCondRptGrid(string query)
{
condRptGrid.RecordCount = countRecord(" WHERE SITE_ID IN (SELECT SITE_ID FROM SITE WHERE CUSTOMER_ID='" + customer + "')");
string sortField = "CURRENT_DT";
string sortOrder = "DESC";
string sortOrderReverse = sortOrder == "ASC" ? "DESC" : "ASC";
//Number of records to display in the current page
int recordsForCurrentPage = condRptGrid.PageSize;
//Number of records included by the current page and
//all pages before the current page
int recordsTillCurrentPage = (condRptGrid.CurrentPage + 1) * condRptGrid.PageSize;
//The current page may be the last page, in which
//case the total number of available records may
//be less than PageSize
if (recordsTillCurrentPage > condRptGrid.RecordCount)
{
recordsForCurrentPage -= recordsTillCurrentPage - condRptGrid.RecordCount;
recordsTillCurrentPage = condRptGrid.RecordCount;
}
query = query + " ORDER BY {1} {2}";
string queryStr1 = string.Format(query, recordsTillCurrentPage, sortField, sortOrder);
string queryStr2 = string.Format("SELECT TOP {0} * FROM ({1}) SYSTEM_CONDITION ORDER BY {2} {3}", recordsForCurrentPage, queryStr1, sortField, sortOrderReverse);
string queryStr3 = string.Format("SELECT * FROM ({0}) SYSTEM_CONDITION ORDER BY {1} {2}", queryStr2, sortField, sortOrder);
SqlDataReader reader = connect.execQueryRetRdr(queryStr3);
condRptGrid.DataSource = reader;
condRptGrid.DataBind();
//rptGrid.DataSource = reader;
//rptGrid.DataBind();
reader.Dispose();
}
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,194
|
Hi, Your code looks fine to us. Please check whether your page encoding is UTF-8. AJAX does not work with other encodings on IE. http://www.essentialobjects.com/forum/postst1563_Arabic-Named-files-problem.aspxIf that's not the problem, please try to isolate the problem into a test project and send the test project to us. Make sure your test code runs and only contain code needed to reproduce the problem (remove your database code). Once we have that we will take a look as soon as possible. Thanks!
|
Rank: Newbie Groups: Member
Joined: 7/6/2011 Posts: 5
|
Thanx. I ll do that. But i put break points in my code and noticed that the on click the second page the the PageIndexChanged event is not executed.
|