This is a migrated thread and some comments may be shown as answers.

OnPageIndexChanging and RadListView?

6 Answers 180 Views
DataPager
This is a migrated thread and some comments may be shown as answers.
James Daresta
Top achievements
Rank 1
James Daresta asked on 30 Mar 2011, 09:11 PM
I am using the the RadDataPager with the ListView. To do some validation before they change pages I need to know when the user clicks to change the page. I saw in the documentation there is the event OnPageIndexChanging. However, it never seems to fire when clicked. Here is what I have. Note I am using ajax manager with the outlying panel. Thanks in advance.

<asp:Panel ID="pForecastCardView_Panel" runat="server">
<telerik:RadListView ID="rlvForecastCardView_Item" runat="server" Width="100%" 
    AllowPaging="true" ItemPlaceholderID="ItemHolder" 
    DataKeyNames="ForecastID,CustomerId,MaterialGroup.MaterialGroupNo,Region.Id,AccountManagerUserName,TradingPartner.TradingPartnerNo,AccountName"
    PageSize="1"
    ValidationSettings-ValidationGroup="vgMainForm"
    onneeddatasource="rlvForecastCardView_Item_NeedDataSource" 
    onitemdatabound="rlvForecastCardView_Item_ItemDataBound" 
    onitemcommand="rlvForecastCardView_Item_ItemCommand" 
        ondatabound="rlvForecastCardView_Item_DataBound" 
        onpageindexchanged="rlvForecastCardView_Item_PageIndexChanged">
    <LayoutTemplate>
         <asp:Panel ID="ItemHolder" runat="server" />
        <telerik:RadDataPager ID="rdpForecastCardView_ItemPager" runat="server" PagedControlID="rlvForecastCardView_Item" Font-Size="9pt" 
            PageSize="1" Visible='<%# (!_pdfRender) %>' >
            <ClientEvents OnPageIndexChanging="rdpForecastCardView_ItemPager_OnPageIndexChanging" />
            <Fields>
                <telerik:RadDataPagerButtonField FieldType="FirstPrev" />
                <telerik:RadDataPagerButtonField FieldType="Numeric" />
                <telerik:RadDataPagerButtonField FieldType="NextLast" />
                <telerik:RadDataPagerTemplatePageField>
                    <PagerTemplate>
                        <table width="100%" cellpadding="0" cellspacing="0" class="TableFullWidth">
                            <tr>
                                <td>
                                    <telerik:RadButton ID="btnSaveNext" runat="server" Text="Save & Next" CommandName="SaveNext" Icon-PrimaryIconUrl="../images/icons/save16x16.gif"></telerik:RadButton>
                                </td>
                                <td align="right">
                                <b>
                                <asp:Label runat="server" ID="CurrentPageLabel" Text="<%# Container.Owner.StartRowIndex+1%>" /></b>
                                of
                                <b>
                                <asp:Label runat="server" ID="TotalItemsLabel" Text="<%# Container.Owner.TotalRowCount%>" />
                                </b>
                                items
                                </td>
                            </tr>
                        </table>
                    </PagerTemplate>
                </telerik:RadDataPagerTemplatePageField>
            </Fields>
        </telerik:RadDataPager>
    </LayoutTemplate>
    <ItemTemplate>
        <table class="ContentTableBordered TableFullWidth" cellspacing="0" cellpadding="4">
            <tr>
                <td class="tableSectionLabelCell" nowrap="nowrap"><asp:Literal ID="lRegionLabel" runat="server" Text="Region" ViewStateMode="Disabled"></asp:Literal></td>
                <td class="tableSectionLabelCell" nowrap="nowrap"><asp:Literal ID="lTradingPartnerLabel" runat="server" Text="Trading Partner" ViewStateMode="Disabled"></asp:Literal></td>
                <td class="tableSectionLabelCell" nowrap="nowrap"><asp:Literal ID="lAccountNameLabel" runat="server" Text="Account Name" ViewStateMode="Disabled"></asp:Literal></td>
                <td class="tableSectionLabelCell" nowrap="nowrap"><asp:Literal ID="lMasterShipToIdLabel" runat="server" Text="Master Ship No" ViewStateMode="Disabled"></asp:Literal></td>
                <td class="tableSectionLabelCell" nowrap="nowrap"><asp:Literal ID="lCityLabel" runat="server" Text="City" ViewStateMode="Disabled"></asp:Literal></td>
                <td class="tableSectionLabelCell" nowrap="nowrap"><asp:Literal ID="lStateLabel" runat="server" Text="State" ViewStateMode="Disabled"></asp:Literal></td>
                <td class="tableSectionLabelCell" nowrap="nowrap"><asp:Literal ID="lAccountManagerLabel" runat="server" Text="Account Manager" ViewStateMode="Disabled"></asp:Literal></td>
            </tr>
            <tr>
                <td class="tableSectionDataCell" nowrap="nowrap"><%# Eval("Region.Description") %> </td>
                <td class="tableSectionDataCell" nowrap="nowrap"><%# Eval("TradingPartner.Name") %> </td>
                <td class="tableSectionDataCell" nowrap="nowrap"><%# Eval("AccountName") %> </td>
                <td class="tableSectionDataCell" nowrap="nowrap"><%# (Eval("MasterShipToId") != null ? Eval("MasterShipToId").ToString().RemoveLeadingZerosFromSAPID() : "") %> </td>
                <td class="tableSectionDataCell" nowrap="nowrap"><%# Eval("City") %> </td>
                <td class="tableSectionDataCell" nowrap="nowrap"><%# Eval("State.UpperStateId") %> </td>
                <td class="tableSectionDataCell" nowrap="nowrap"><%# Eval("AccountManagerName") %> </td>
            </tr>
            <tr>
                <td class="tableSectionLabelCell" nowrap="nowrap"><asp:Literal ID="lMaterialGroupLabel" runat="server" Text="Material Group" ViewStateMode="Disabled"></asp:Literal></td>
                <td class="tableSectionLabelCell" nowrap="nowrap"><asp:Literal ID="lMaterialNoLabel" runat="server" Text="Material No" ViewStateMode="Disabled"></asp:Literal></td>
                <td class="tableSectionLabelCell" nowrap="nowrap"><asp:Literal ID="lMaterialLabel" runat="server" Text="Material" ViewStateMode="Disabled"></asp:Literal></td>
                <td class="tableSectionLabelCell" nowrap="nowrap"><asp:Literal ID="lDefaultShippingModeLabel" runat="server" Text="Default Mode" ViewStateMode="Disabled"></asp:Literal></td>
                <td class="tableSectionLabelCell" nowrap="nowrap"><asp:Literal ID="lDefaultPlantLabel" runat="server" Text="Default Plant" ViewStateMode="Disabled"></asp:Literal></td>
                <td class="tableSectionLabelCell" nowrap="nowrap"><asp:Literal ID="lDefaultPlantNoLabel" runat="server" Text="Default Plant No" ViewStateMode="Disabled"></asp:Literal></td>
                <td class="tableSectionLabelCell" nowrap="nowrap"><asp:Literal ID="lIsProspect" runat="server" Text="Is Prospect" ViewStateMode="Disabled"></asp:Literal></td>
            </tr>
            <tr>
                <td class="tableSectionDataCell" nowrap="nowrap"><%# Eval("MaterialGroup.Description") %> </td>
                <td class="tableSectionDataCell" nowrap="nowrap"><%# (Eval("DefaultMaterial.MaterialNo") != null ? Eval("DefaultMaterial.MaterialNo").ToString().RemoveLeadingZerosFromSAPID() : "") %> </td>
                <td class="tableSectionDataCell" nowrap="nowrap"><%# Eval("DefaultMaterial.Description") %> </td>
                <td class="tableSectionDataCell" nowrap="nowrap"><%# Eval("DefaultShipMode.Description")%> </td>
                <td class="tableSectionDataCell" nowrap="nowrap"><%# Eval("DefaultPlant.Id") %> </td>
                <td class="tableSectionDataCell" nowrap="nowrap"><%# Eval("DefaultPlant.Description")%> </td>
                <td class="tableSectionDataCell" nowrap="nowrap"><%# (Convert.ToBoolean(Eval("IsProspect")) ? "Yes" : "No") %> </td>
            </tr>
        </table>                
        <br />
        <% if (!_pdfRender)
           { %>
        <div class="RadGrid RadGrid_Default" style="border-bottom: 0px none transparent">
        <table cellspacing="0" class="rgMasterTable" border="0" style="width:100%;table-layout:auto;empty-cells:show;">
            <tr>
                <th class="rgHeader" style="text-align:left;">
                    <telerik:RadButton ID="btnSaveValues" runat="server" CommandName="Save" Icon-PrimaryIconUrl="../images/icons/save16x16.gif" Text="Save Values"></telerik:RadButton
                </th>
                <th class="rgHeader" style="text-align:right;">
                     <telerik:RadButton ID="btnPDF" runat="server" CommandArgument='<%# (Eval("ForecastID").ToString() + "~" +  Eval("CustomerId").ToString() + "~" + Eval("MaterialGroup.MaterialGroupNo").ToString() + "~" + Eval("AccountName").ToString() + "~" + Eval("MaterialGroup.Description").ToString()) %>'  Text="PDF/Print" OnClientClicked="OnClientPDF_Clicking" ValidationGroup="vgMainForm" Icon-PrimaryIconUrl="../images/icons/acrobat.gif" AutoPostBack="false">
                    </telerik:RadButton>
                     <telerik:RadButton ID="btnRefresh" runat="server" CommandName="RebindListView" Text="Refresh" ValidationGroup="vgMainForm">
                        <Icon PrimaryIconCssClass="rbRefresh" />
                    </telerik:RadButton>
                </th>
            </tr>
        </table>
        </div>
        <% } %>
        <% if (_pdfRender)
           { %>
        <table class="TableFullWidth" style="border-top: 1px solid #828282;border-bottom: 1px solid #828282;border-left: 1px solid #828282;border-right: 1px solid #828282;" cellspacing="0" cellpadding="4">
        <% }
           else
           
             %>
        <table class="TableFullWidth" style="border-top: 0px none transparent;border-bottom: 0px none transparent;border-left: 1px solid #828282;border-right: 1px solid #828282;" cellspacing="0" cellpadding="4">
        <% } %>
            <tr>
                <td align="center">
                    <asp:Label ID="lblPriorActualVolumeLabel" runat="server" CssClass="LabelMedium LabelBold" Text="Prior Periods Actual Volume" ViewStateMode="Disabled"></asp:Label>                            
                </td>
                <td align="center">
                    <asp:Label ID="lblAccountRepForecastLabel" runat="server" CssClass="LabelMedium LabelBold" Text="Account Rep Forecast" ViewStateMode="Disabled"></asp:Label>                            
                </td>
                <td align="center">
                    <asp:Label ID="lblManagementForecast" runat="server" CssClass="LabelMedium LabelBold" Text="Management Forecast" ViewStateMode="Disabled"></asp:Label>                            
                </td>
            </tr>
            <tr>
                <td width="34%" nowrap="nowrap">
                    <telerik:RadGrid ID="rgPriorActualVolumeValues" runat="server" 
                        AllowFilteringByColumn="False" 
                        AllowPaging="False" 
                        AllowSorting="false"
                        ClientSettings-AllowColumnHide="false" 
                        AutoGenerateColumns="False" 
                        ShowGroupPanel="false"
                        ShowFooter="true"
                        EnableHeaderContextMenu="false">
                    <MasterTableView
                        CommandItemDisplay="None">
                    <Columns>
                        <telerik:GridTemplateColumn HeaderText="PeriodDate" UniqueName="PeriodDate" DataField="PeriodDate" FooterStyle-Font-Bold="true" ItemStyle-HorizontalAlign="Right" ItemStyle-Wrap="false" HeaderStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                            <%# FormatPeriodDisplay(Convert.ToDateTime(Eval("PeriodDate"))) %>
                            </ItemTemplate>
                            <FooterTemplate>
                                <asp:Literal ID="lTotal" runat="server" EnableViewState="false" Text="Total:"  ViewStateMode="Disabled"></asp:Literal>
                            </FooterTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="ActualValue" UniqueName="ActualValue" DataField="ActualValue" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <telerik:RadNumericTextBox ID="rntxtActualValue" runat="server" Text='<%# Eval("ActualValue") %>' Type="Number" DataType="System.Int32" NumberFormat-DecimalDigits="0" NumberFormat-GroupSizes="3" NumberFormat-GroupSeparator="," EnabledStyle-HorizontalAlign="Right" ReadOnly="true" ReadOnlyStyle-BorderColor="Transparent" ReadOnlyStyle-ForeColor="Black" ReadOnlyStyle-BackColor="Transparent"  Width="100px" ViewStateMode="Disabled"></telerik:RadNumericTextBox>
                            </ItemTemplate>
                            <FooterTemplate>
                                <telerik:RadNumericTextBox ID="rntxtActualValueFooter" runat="server" Type="Number" DataType="System.Int32" NumberFormat-DecimalDigits="0" NumberFormat-GroupSizes="3" NumberFormat-GroupSeparator="," EnabledStyle-HorizontalAlign="Right" ReadOnly="true" ReadOnlyStyle-HorizontalAlign="Right" ReadOnlyStyle-BorderColor="Transparent" ReadOnlyStyle-ForeColor="Black" ReadOnlyStyle-BackColor="Transparent" Width="100px" ViewStateMode="Disabled"></telerik:RadNumericTextBox>
                            </FooterTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn DataField="QuarterlyValue" Groupable="false" HeaderText="Quarterly" UniqueName="QuarterlyValue" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" DataType="System.Int32" DataFormatString="{0:#,###,###,##0}">
                        </telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn HeaderText="OutageDays" UniqueName="OutageDays" DataField="OutageDays" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <telerik:RadNumericTextBox ID="rntxtOutageDays" runat="server" Text='<%# Eval("OutageDays") %>' Type="Number" DataType="System.Int32" NumberFormat-DecimalDigits="0" NumberFormat-GroupSizes="3" NumberFormat-GroupSeparator="," EnabledStyle-HorizontalAlign="Right" ReadOnly="true" ReadOnlyStyle-HorizontalAlign="Right" ReadOnlyStyle-BorderColor="Transparent" ReadOnlyStyle-ForeColor="Black" ReadOnlyStyle-BackColor="Transparent" Width="100px" ViewStateMode="Disabled"></telerik:RadNumericTextBox>
                            </ItemTemplate>
                            <FooterTemplate>
                                <telerik:RadNumericTextBox ID="rntxtOutageDaysFooter" runat="server" Type="Number" DataType="System.Int32" NumberFormat-DecimalDigits="0" NumberFormat-GroupSizes="3" NumberFormat-GroupSeparator="," EnabledStyle-HorizontalAlign="Right" ReadOnly="true" ReadOnlyStyle-HorizontalAlign="Right" ReadOnlyStyle-BorderColor="Transparent" ReadOnlyStyle-ForeColor="Black" ReadOnlyStyle-BackColor="Transparent" Width="100px" ViewStateMode="Disabled"></telerik:RadNumericTextBox>
                            </FooterTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                    <NoRecordsTemplate>
                    <asp:Label ID="lblNoTotalsRecords" runat="server" CssClass="LabelBold" Text="No records for the filtering selections you have chosen." ViewStateMode="Disabled"></asp:Label>
                    </NoRecordsTemplate>
                    </MasterTableView>
                    </telerik:RadGrid>
                </td>
                <td width="34%" nowrap="nowrap">
                    <telerik:RadGrid ID="rgAccountManagerValues" runat="server" 
                        AllowFilteringByColumn="False" 
                        AllowPaging="False" 
                        AllowSorting="false"
                        ClientSettings-AllowColumnHide="false" 
                        AutoGenerateColumns="False" 
                        ShowGroupPanel="false"
                        ShowFooter="true"
                        EnableHeaderContextMenu="false"
                        OnItemDataBound="rgAccountManagerValues_ItemDataBound">
                    <MasterTableView
                        CommandItemDisplay="None"
                        DataKeyNames="ForecastValueId,PeriodDate,AccountManagerValue,OutageDays,IsPrevYearActual">
                    <RowIndicatorColumn>
                    <HeaderStyle Width="20px"></HeaderStyle>
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn>
                    <HeaderStyle Width="20px"></HeaderStyle>
                    </ExpandCollapseColumn>
                    <Columns>
                        <telerik:GridTemplateColumn HeaderText="PeriodDate" UniqueName="PeriodDate" DataField="PeriodDate" FooterStyle-Font-Bold="true" ItemStyle-HorizontalAlign="Right" ItemStyle-Wrap="false" HeaderStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                            <%# FormatPeriodDisplay(Convert.ToDateTime(Eval("PeriodDate"))) %>
                            </ItemTemplate>
                            <FooterTemplate>
                                <asp:Literal ID="lTotal" runat="server" EnableViewState="false" Text="Total:"  ViewStateMode="Disabled"></asp:Literal>
                            </FooterTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="AccountManagerValue" UniqueName="AccountManagerValue" DataField="AccountManagerValue" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center"  FooterStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <telerik:RadNumericTextBox ID="rntxtAcctRepForecast" runat="server" Text='<%# Eval("AccountManagerValue") %>' Type="Number" DataType="System.Int32" NumberFormat-DecimalDigits="0" NumberFormat-GroupSizes="3" NumberFormat-GroupSeparator="," EnabledStyle-HorizontalAlign="Right"  Width="100px" ReadOnlyStyle-BorderColor="Transparent" ReadOnlyStyle-ForeColor="Black" ReadOnlyStyle-BackColor="Transparent"></telerik:RadNumericTextBox>
                            </ItemTemplate>
                            <FooterTemplate>
                                <telerik:RadNumericTextBox ID="rntxtAcctRepForecastFooter" runat="server" Type="Number" DataType="System.Int32" NumberFormat-DecimalDigits="0" NumberFormat-GroupSizes="3" NumberFormat-GroupSeparator="," EnabledStyle-HorizontalAlign="Right" ReadOnly="true" ReadOnlyStyle-HorizontalAlign="Right" ReadOnlyStyle-BorderColor="Transparent" ReadOnlyStyle-ForeColor="Black" ReadOnlyStyle-BackColor="Transparent" Width="100px"></telerik:RadNumericTextBox>
                            </FooterTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn DataField="QuarterlyValue" HeaderText="Quarterly" UniqueName="QuarterlyValue" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" DataType="System.Int32" DataFormatString="{0:#,###,###,##0}">
                        </telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn HeaderText="OutageDays" UniqueName="OutageDays" DataField="OutageDays" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <telerik:RadNumericTextBox ID="rntxtOutageDays" runat="server" Text='<%# Eval("OutageDays") %>' Type="Number" DataType="System.Int32" NumberFormat-DecimalDigits="0" NumberFormat-GroupSizes="3" NumberFormat-GroupSeparator="," EnabledStyle-HorizontalAlign="Right"  Width="100px" ReadOnlyStyle-BorderColor="Transparent" ReadOnlyStyle-ForeColor="Black" ReadOnlyStyle-BackColor="Transparent"></telerik:RadNumericTextBox>
                            </ItemTemplate>
                            <FooterTemplate>
                                <telerik:RadNumericTextBox ID="rntxtOutageDaysFooter" runat="server" Type="Number" DataType="System.Int32" NumberFormat-DecimalDigits="0" NumberFormat-GroupSizes="3" NumberFormat-GroupSeparator="," EnabledStyle-HorizontalAlign="Right" ReadOnly="true" ReadOnlyStyle-HorizontalAlign="Right" ReadOnlyStyle-BorderColor="Transparent" ReadOnlyStyle-ForeColor="Black" ReadOnlyStyle-BackColor="Transparent" Width="100px"></telerik:RadNumericTextBox>
                            </FooterTemplate>
                        </telerik:GridTemplateColumn>
                    </Columns>
                    <NoRecordsTemplate>
                    <asp:Label ID="lblNoTotalsRecords" runat="server" CssClass="LabelBold" Text="No records for the filtering selections you have chosen." ViewStateMode="Disabled"></asp:Label>
                    </NoRecordsTemplate>
                    </MasterTableView>
                    </telerik:RadGrid>                            
                </td>
                <td width="34%" nowrap="nowrap">
                    <telerik:RadGrid ID="rgManagementAllocationValues" runat="server" 
                        AllowFilteringByColumn="False" 
                        AllowPaging="False" 
                        AllowSorting="false"
                        ClientSettings-AllowColumnHide="false" 
                        AutoGenerateColumns="False" 
                        ShowGroupPanel="false"
                        ShowFooter="true"
                        EnableHeaderContextMenu="false"
                        OnItemDataBound="rgManagementAllocationValues_ItemDataBound">
                    <MasterTableView
                        CommandItemDisplay="None"
                        DataKeyNames="ForecastValueId,PeriodDate,ManagementAllocationValue">
                    <RowIndicatorColumn>
                    <HeaderStyle Width="20px"></HeaderStyle>
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn>
                    <HeaderStyle Width="20px"></HeaderStyle>
                    </ExpandCollapseColumn>
                    <Columns>
                        <telerik:GridTemplateColumn HeaderText="PeriodDate" UniqueName="PeriodDate" DataField="PeriodDate" FooterStyle-Font-Bold="true" ItemStyle-HorizontalAlign="Right" ItemStyle-Wrap="false" HeaderStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                            <%# FormatPeriodDisplay(Convert.ToDateTime(Eval("PeriodDate"))) %>
                            </ItemTemplate>
                            <FooterTemplate>
                                <asp:Literal ID="lTotal" runat="server" EnableViewState="false" Text="Total:"></asp:Literal>
                            </FooterTemplate>
                        </telerik:GridTemplateColumn>                                  
                        <telerik:GridTemplateColumn HeaderText="ManagementAllocationValue" UniqueName="ManagementAllocationValue" DataField="ManagementAllocationValue" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" FooterStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <telerik:RadNumericTextBox ID="rntxtMgmtAllocation" runat="server" Text='<%# Eval("ManagementAllocationValue") %>' Type="Number" DataType="System.Int32" NumberFormat-DecimalDigits="0" NumberFormat-GroupSizes="3" NumberFormat-GroupSeparator="," EnabledStyle-HorizontalAlign="Right" Width="100px" ReadOnlyStyle-BorderColor="Transparent" ReadOnlyStyle-ForeColor="Black" ReadOnlyStyle-BackColor="Transparent"></telerik:RadNumericTextBox>
                            </ItemTemplate>
                            <FooterTemplate>
                                <telerik:RadNumericTextBox ID="rntxtMgmtAllocationFooter" runat="server" Type="Number" DataType="System.Int32" NumberFormat-DecimalDigits="0" NumberFormat-GroupSizes="3" NumberFormat-GroupSeparator="," EnabledStyle-HorizontalAlign="Right" ReadOnly="true" ReadOnlyStyle-HorizontalAlign="Right" ReadOnlyStyle-BorderColor="Transparent" ReadOnlyStyle-ForeColor="Black" ReadOnlyStyle-BackColor="Transparent" Width="100px"></telerik:RadNumericTextBox>
                            </FooterTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn DataField="QuarterlyValue" HeaderText="Quarterly" UniqueName="QuarterlyValue" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Right" DataType="System.Int32" DataFormatString="{0:#,###,###,##0}">
                        </telerik:GridBoundColumn>
                    </Columns>
                    <NoRecordsTemplate>
                    <asp:Label ID="lblNoTotalsRecords" runat="server" CssClass="LabelBold" Text="No records for the filtering selections you have chosen."></asp:Label>
                    </NoRecordsTemplate>
                    </MasterTableView>
                    </telerik:RadGrid>                              
                  
                </td>
            </tr>
        </table>
    </ItemTemplate>
    <EmptyDataTemplate>
        <div class="RadGrid RadGrid_Default" style="border-bottom: 0px none transparent">
        <table cellspacing="0" class="rgMasterTable" border="0" style="width:100%;table-layout:auto;empty-cells:show;">
            <tr>
                <th class="rgHeader" style="text-align:left;">
                       
                </th>
            </tr>
            <tr  class="rgNoRecords">
                <td>
                    <asp:Label ID="lblNoTotalsRecords" runat="server" CssClass="LabelBold" Text="No records for the filtering selections you have chosen." ViewStateMode="Disabled"></asp:Label>
                    <br />
                       
                </td>
            </tr>
        </table>
        </div>
        <telerik:RadGrid ID="dummyGrid" runat="server" ViewStateMode="Disabled"></telerik:RadGrid>
    </EmptyDataTemplate>
</telerik:RadListView>
</asp:Panel>

Client-side function

function rdpForecastCardView_ItemPager_OnPageIndexChanging(sender, eventArgs) {
    alert('here');
    eventArgs.set_cancel((!Page_ClientValidate('vgMainForm')));
}

6 Answers, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 05 Apr 2011, 05:46 AM
Hello James,

You should use the ItemCommand event of the list view control as follows:

protected void RadListView1_ItemCommand(object sender, RadListViewCommandEventArgs e)
{
    if (e.CommandName == RadListView.PageCommandName)
    {
        if (//custom validation)
        {
            e.Canceled = true;
        }
    }
}

Hope it helps. 

Greetings,
Tsvetoslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
James Daresta
Top achievements
Rank 1
answered on 05 Apr 2011, 01:51 PM
No I am afraid it does not help. I need to handle the event on the client. Thats why I was looking at the client event for the pager OnPageIndexChanging to capture it. However, it seems that it never gets called. Even when I take the pager out of the List View template it does not fire when one clicks on a new page.
0
Tsvetoslav
Telerik team
answered on 08 Apr 2011, 10:22 AM
Hi James,

I saw what you meant and it turns out your are correct. We shall need some more time to investigate the issue and will be getting back to you with our findings. 

Best wishes,
Tsvetoslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Tsvetoslav
Telerik team
answered on 12 Apr 2011, 01:21 PM
Hi James,

I related your case to our development team and they explained that the PageIndexChanged event on the client is raised only when you are firing a page command from the client through the set_currentPageIndex() client method. Therefore, this behavior is by design and a change in it will require a modification for the worse in the rendering of the data pager control and its server-side implementation.

Regards,

Tsvetoslav
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

0
James Daresta
Top achievements
Rank 1
answered on 12 Apr 2011, 02:06 PM
So does this mean that the event will not happen on the client end when a users clicks the pager to change the page? What can I do to have this happen now? I need when they click the pager to change the page to intercept it on the client side. I cannot use the list control because there is no client oncommand event. I need something on the client side. Thanks.
0
Tsvetoslav
Telerik team
answered on 15 Apr 2011, 02:17 PM
Hi James,

What I'd suggest that you use RadDataPagerTemplatePageField  and place your own paging buttons attaching appropriate command names and a client-side handler where you can implement your custom functionality. 

Best wishes,
Tsvetoslav
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
DataPager
Asked by
James Daresta
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
James Daresta
Top achievements
Rank 1
Share this question
or