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

RadGrid in RadMultiPage.RadPageView blocks the Pager function

1 Answer 66 Views
Grid
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 07 Aug 2010, 07:47 AM

I put a radgrid in a RadMultiPage, seems the Pager is not working well, anyone know how could it get it work, really thanks!
when i click to page 2, it seems refresh the radgrid, i know this because i saw that after i grouping the list with dragging a colum on top of the grid, when i click page 2, the group disappeared, and the grid list refresh to Page 1, but not Page2.
So i guess, it must refresh to page1,
The same code(both html and C# code behind) works well if the radgrid were not in a radMultiPage control.
Following is my code

 

<telerik:RadPageView ID="RadPageView11" runat="server"
                <div id="RadPageViewDiv11" class="div_details_container"
                                <telerik:RadGrid ID="dtg_search" runat="server" GridLines="None" AllowSorting="True"
                                    ShowGroupPanel="True" AutoGenerateColumns="False" OnItemDataBound="dtg_search_ItemDataBound"
                                    OnNeedDataSource="dtg_search_NeedDataSource" AllowPaging="True" PageSize="<%$ AppSettings:DefaultPageSize %>" 
                                    AllowCustomPaging="True"> 
                                    <GroupPanel Text="拖动任何一列的标题栏到这里,可以按照该列分组显示数据"
                                    </GroupPanel
                                    <PagerStyle Mode="<%$ AppSettings:DefaultPagerStyle %>" AlwaysVisible="True" /> 
                                    <MasterTableView CellSpacing="-1" Width="100%" ClientDataKeyNames="id,show_id" DataKeyNames="id,show_id"
                                        CommandItemDisplay="<%$ AppSettings:DefaultCommandItemDisplay %>"> 
                                        <Columns
                                            <telerik:GridTemplateColumn HeaderStyle-Width="10px"
                                                <HeaderTemplate
                                                    <input id="chk_selectAll" onclick="selectAll(this);" type="checkbox" value="" /> 
                                                </HeaderTemplate
                                                <ItemTemplate
                                                    <input id="chk_ok" type="checkbox" value='<%#DataBinder.Eval(Container.DataItem,"id")%>' /> 
                                                </ItemTemplate
                                                <HeaderStyle Width="28px"></HeaderStyle
                                            </telerik:GridTemplateColumn
                                            <telerik:GridTemplateColumn HeaderStyle-Wrap="false" HeaderText="票座名称" UniqueName="ticketSeatColumn"
                                                SortExpression="ticket_seat" Groupable="false"
                                                <ItemTemplate
                                                    <asp:LinkButton ID="lnk_detail" runat="server" ToolTip='<%#DataBinder.Eval(Container.DataItem,"ticket_seat")%>' 
                                                        CommandName="CMD_DETAIL"><%# CutLeftString(DataBinder.Eval(Container.DataItem, "ticket_seat").ToString())%></asp:LinkButton
                                                </ItemTemplate
                                                <ItemStyle HorizontalAlign="Left"></ItemStyle
                                            </telerik:GridTemplateColumn
                                            <telerik:GridBoundColumn HeaderStyle-Wrap="false" UniqueName="ticketQuantityColumn"
                                                HeaderText="单位数量" HeaderStyle-Width="100px" ItemStyle-HorizontalAlign="Right"
                                                DataField="ticket_quantity"
                                            </telerik:GridBoundColumn
                                            <telerik:GridBoundColumn HeaderStyle-Wrap="false" UniqueName="ticketPriceColumn"
                                                HeaderText="单价" HeaderStyle-Width="100px" ItemStyle-HorizontalAlign="Left" DataField="ticket_price"
                                            </telerik:GridBoundColumn
                                            <telerik:GridBoundColumn HeaderStyle-Wrap="false" UniqueName="ticketZoneColumn" HeaderText="对应座位区域"
                                                HeaderStyle-Width="100px" ItemStyle-HorizontalAlign="Left" DataField="ticket_zone"
                                            </telerik:GridBoundColumn
                                            <telerik:GridBoundColumn HeaderStyle-Wrap="false" UniqueName="priceMemoColumn" HeaderText="备注"
                                                HeaderStyle-Width="100px" ItemStyle-HorizontalAlign="Left" DataField="price_memo"
                                            </telerik:GridBoundColumn
                                        </Columns
                                        <CommandItemTemplate
                                            <asp:LinkButton ID="btn_newRecord" runat="server" OnClientClick="return ShowInsertForm(false);"
                                                Text="添加记录" /> 
                                             |  
                                            <asp:LinkButton ID="btn_DeleteRows" runat="server" OnClientClick="if(!onDelete()) return false;"
                                                OnClick="btn_DeleteRows_Click" Text="删除记录" /> 
                                            <asp:LinkButton ID="btn_showErrorLog" runat="server" OnClientClick="return false;"
                                                CssClass="errorLogbutton" Text="<%$ AppSettings:ProductErrorLogSign %>" Visible="false" /> 
                                        </CommandItemTemplate
                                    </MasterTableView
                                    <ClientSettings AllowDragToGroup="True" EnableRowHoverStyle="True" AllowColumnsReorder="True"
                                        <Scrolling UseStaticHeaders="True" /> 
                                        <Selecting AllowRowSelect="true" /> 
                                        <ClientEvents OnRowDblClick="RowDblClick" /> 
                                        <Resizing AllowColumnResize="True" /> 
                                    </ClientSettings
                                </telerik:RadGrid
                </div
                <asp:HiddenField ID="hdn_selectedIDs" runat="server" /> 
                <asp:HiddenField ID="hdn_errorLog" runat="server" /> 
                <telerik:RadCodeBlock ID="RadCodeBlock2" runat="server"
    
                    <script type="text/javascript"
                        function ShowEditForm(id, show_id, rowIndex) { 
                            var grid = $find("<%= dtg_search.ClientID %>"); 
    
                            var rowControl = grid.get_masterTableView().get_dataItems()[rowIndex].get_element(); 
                            grid.get_masterTableView().selectItem(rowControl, true); 
    
                            window.radopen("ShowTicketPriceManagerForm.aspx?" + "<%=this.GetEditPageCommand() %>" + "&t0=" + id + "&t1=" + show_id, "PriceManagerFormWindow"); 
                            return false; 
                        
    
                        function ShowInsertForm(arg) { 
                            if (arg == true) { 
                                window.radopen("ShowTicketPriceManagerForm.aspx?" + "<%=this.GetInsertPageCommand() %>" + "&t1=" + '<%=Request.Params["t0"]%>', "PriceManagerFormWindow"); 
                            
                            else { 
                                alert("新增记录权限尚未对当前用户开放"); 
                            
                            return false; 
                        
    
                        function refreshGrid(arg) { 
                            if (arg) { 
    
                                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind"); 
                            
                            else { 
                                $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate"); 
                            
                        
                        function RowDblClick(sender, eventArgs) { 
                            window.radopen("ShowTicketPriceManagerForm.aspx?" + "<%=this.GetEditPageCommand() %>" + "&t0=" + eventArgs.getDataKeyValue("id") + "&t1=" + eventArgs.getDataKeyValue("show_id"), "PriceManagerFormWindow"); 
                        
                    </script
    
                </telerik:RadCodeBlock
                <telerik:RadScriptManager ID="RadScriptManager1" runat="server" EnablePageMethods="True"
                </telerik:RadScriptManager
                <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Modal="true"
                    <Windows
                        <telerik:RadWindow ID="PriceManagerFormWindow" runat="server" ShowContentDuringLoad="false"
                            VisibleStatusbar="false" VisibleOnPageLoad="false" Height="320" Width="700" Title="Telerik RadWindow"
                            Behaviors="Default"
                        </telerik:RadWindow
                    </Windows
                </telerik:RadWindowManager
                <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server"
                </telerik:RadAjaxLoadingPanel
                <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest"
                    <AjaxSettings
                        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1"
                            <UpdatedControls
                                <telerik:AjaxUpdatedControl ControlID="dtg_search" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                            </UpdatedControls
                        </telerik:AjaxSetting
                        <telerik:AjaxSetting AjaxControlID="dtg_search"
                            <UpdatedControls
                                <telerik:AjaxUpdatedControl ControlID="dtg_search" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                            </UpdatedControls
                        </telerik:AjaxSetting
                        <telerik:AjaxSetting AjaxControlID="RadWindowManager1"
                            <UpdatedControls
                                <telerik:AjaxUpdatedControl ControlID="dtg_search" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                            </UpdatedControls
                        </telerik:AjaxSetting
                    </AjaxSettings
                </telerik:RadAjaxManager
            </telerik:RadPageView>

 

protected void RadAjaxManager1_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e) 
    if (e.Argument == "Rebind"
    
        dtg_search.MasterTableView.SortExpressions.Clear(); 
        dtg_search.MasterTableView.GroupByExpressions.Clear(); 
        dtg_search.Rebind(); 
    
    else if (e.Argument == "RebindAndNavigate"
    
        dtg_search.MasterTableView.SortExpressions.Clear(); 
        dtg_search.MasterTableView.GroupByExpressions.Clear(); 
        dtg_search.MasterTableView.CurrentPageIndex = dtg_search.MasterTableView.PageCount - 1; 
        dtg_search.Rebind(); 
    

1 Answer, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 12 Aug 2010, 08:11 AM
Hi David,

I tried to reproduce the described issue, but to no avail. I am sending you a simple example based on your code. Please check it out and let me know what differs in your case.
Additionally please check out the following documentation article which explains the RadGrid's custom paging:
http://www.telerik.com/help/aspnet-ajax/grdcustompaging.html

Looking forward for your reply.

Kind regards,
Radoslav
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
Tags
Grid
Asked by
David
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Share this question
or