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

RadGrid Paging not working inside PopupControlExtender

3 Answers 148 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ravi
Top achievements
Rank 1
Ravi asked on 22 Mar 2012, 04:53 AM
Hi All,

       I have grid in PopupControlExtender and paging is not working for Next, Previous buttons. 
      I am using need datasource event also.Can you Please Help me to solve this issue.

Here is My code.

 

<asp:Panel ID="pnlSearch" runat="server" DefaultButton="ibtnSearch">
    <table cellpadding="0" cellspacing="0" class="search_restaurant_table">
        <tr>
            <td class="search_restaurant_table_right">
                 </td>
            <td class="search_restaurant_table_spacer">
                 </td>
            <td>
                <asp:HiddenField ID="hidResId" runat="server" />
                <asp:HiddenField ID="hidMessage" runat="server" Value="Search Restaurant (Name/Type/Category/Cuisine)." />
            </td>
        </tr>
        <tr>
            <td class="search_restaurant_table_right">
                <asp:Label ID="lblTitle" runat="server" SkinID="label_9_bold"
                    Text="Restaurant :" Width="170"></asp:Label>
            </td>
            <td class="search_restaurant_table_spacer">
                 </td>
            <td>
                <table cellpadding="0" cellspacing="0" class="search_restaurant_table">
                    <tr>
                        <td class="search_restaurant_table_inner">
                            <asp:TextBox ID="txtRestaurantSearch" runat="server" Width="400px" AutoComplete="Off" ></asp:TextBox>
                            <cc1:PopupControlExtender ID="txtRestaurantSearch_PopupControlExtender" runat="server" TargetControlID="txtRestaurantSearch"
                                PopupControlID="pnlRestaurant" Position="Bottom" OffsetY="0">
                            </cc1:PopupControlExtender>
                            <telerik:RadWindowManager ID="rwmResInfo" runat="server" Style="width: 750px; height: 350px"
                                OnClientShow="radResInfo_show" OnClientClose="radResInfo_close" Behavior="Default"
                                InitialBehavior="Default" EnableViewState="false" Modal="true" VisibleStatusbar="false">
                                <Windows>
                                    <telerik:RadWindow ID="rwdResInfo" runat="server" Skin="Office2007">
                                    </telerik:RadWindow>
                                </Windows>
                            </telerik:RadWindowManager>
                        </td>
                        <td>
                            <asp:ImageButton ID="ibtnSearch" runat="server" CausesValidation="False"
                                ImageUrl="~/Images/page/search.png" ToolTip="Search" />
                            <div style="position: fixed; left: 110%;">
                                <asp:Button ID="btnPostBack" runat="server" CausesValidation="false" Visible="true"
                                    Width="1" Height="1"/>
                            </div>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td class="search_restaurant_table_right">
                 </td>
            <td class="search_restaurant_table_spacer">
                 </td>
            <td align="left">
                <asp:Label ID="lblMessage" runat="server" SkinID="label_8" Text="Search Restaurant (Name/Type/Category/Cuisine)."></asp:Label>
                <asp:RequiredFieldValidator ID="rfvRestaurant" runat="server" ControlToValidate="txtRestaurantSearch"
                    Display="Dynamic" ErrorMessage="* Select Restaurant" Enabled="False"></asp:RequiredFieldValidator>
                <div style="position: absolute; left: 110%;">
                    <asp:Panel ID="pnlRestaurant" runat="server" BackColor="#E6F2E7" Width="670px" BorderWidth="1"
                        BorderStyle="NotSet" BorderColor="#999999">
                        <div style="width:100%; margin:0px auto; overflow-y:scroll;">
                            <table cellpadding="0" cellspacing="0" style="padding:5px; width:95%;">
                                <tr>
                                    <td style="background-color:#D1DEBE;" align="Left">
                                        <table cellpadding="0" cellspacing="0" class="search_restaurant_table">
                                            <tr>
                                                <td class="search_restaurant_table_search_more">
                                                    <asp:LinkButton ID="lbtnSearch" runat="server" CausesValidation="False"
                                                        SkinID="linkbutton_8" Text="Search more">
                                        </asp:LinkButton>
                                                    <asp:Label ID="Label2" runat="server" SkinID="label_8" Text="with filters.">
                                        </asp:Label>
                                                </td>
                                                <td>
                                                    <table cellpadding="0" cellspacing="0" class="search_restaurant_table">
                                                        <tr>
                                                            <td class="search_restaurant_table_sort">
                                                                <asp:Label ID="Label3" runat="server" SkinID="label_8" Text="Sortings :"></asp:Label>
                                                            </td>
                                                            <td class="search_restaurant_table_right">
                                                                 </td>
                                                            <td class="search_restaurant_table_sort_parameter">
                                                                <asp:DropDownList ID="cmbSort1" runat="server" SkinID="dropdownlist_8"
                                                                    Width="80px">
                                                                    <asp:ListItem Text="(None)" Value=""></asp:ListItem>
                                                                    <asp:ListItem Text="Name" Value="Name"></asp:ListItem>
                                                                    <asp:ListItem Text="Category" Value="Category"></asp:ListItem>
                                                                    <asp:ListItem Text="Cuisine" Value="Cuisine"></asp:ListItem>
                                                                    <asp:ListItem Text="Type" Value="Type"></asp:ListItem>
                                                                </asp:DropDownList>
                                                            </td>
                                                            <td class="search_restaurant_table_sort_value">
                                                                <asp:DropDownList ID="cmbSort1Value" runat="server" SkinID="dropdownlist_8"
                                                                    Width="50px">
                                                                    <asp:ListItem Text="Asc" Value="Asc"></asp:ListItem>
                                                                    <asp:ListItem Text="Desc" Value="Desc"></asp:ListItem>
                                                                </asp:DropDownList>
                                                            </td>
                                                            <td class="search_restaurant_table_sort_parameter">
                                                                <asp:DropDownList ID="cmbSort2" runat="server" SkinID="dropdownlist_8"
                                                                    Width="80px">
                                                                    <asp:ListItem Text="(None)" Value=""></asp:ListItem>
                                                                    <asp:ListItem Text="Name" Value="Name"></asp:ListItem>
                                                                    <asp:ListItem Text="Category" Value="Category"></asp:ListItem>
                                                                    <asp:ListItem Text="Cuisine" Value="Cuisine"></asp:ListItem>
                                                                    <asp:ListItem Text="Type" Value="Type"></asp:ListItem>
                                                                </asp:DropDownList>
                                                            </td>
                                                            <td class="search_restaurant_table_sort_value">
                                                                <asp:DropDownList ID="cmbSort2Value" runat="server" SkinID="dropdownlist_8"
                                                                    Width="50px">
                                                                    <asp:ListItem Text="Asc" Value="Asc"></asp:ListItem>
                                                                    <asp:ListItem Text="Desc" Value="Desc"></asp:ListItem>
                                                                </asp:DropDownList>
                                                            </td>
                                                            <td class="search_restaurant_table_sort_parameter">
                                                                <asp:DropDownList ID="cmbSort3" runat="server" SkinID="dropdownlist_8"
                                                                    Width="80px">
                                                                    <asp:ListItem Text="(None)" Value=""></asp:ListItem>
                                                                    <asp:ListItem Text="Name" Value="Name"></asp:ListItem>
                                                                    <asp:ListItem Text="Category" Value="Category"></asp:ListItem>
                                                                    <asp:ListItem Text="Cuisine" Value="Cuisine"></asp:ListItem>
                                                                    <asp:ListItem Text="Type" Value="Type"></asp:ListItem>
                                                                </asp:DropDownList>
                                                            </td>
                                                            <td class="search_restaurant_table_sort_value">
                                                                <asp:DropDownList ID="cmbSort3Value" runat="server" SkinID="dropdownlist_8"
                                                                    Width="50px">
                                                                    <asp:ListItem Text="Asc" Value="Asc"></asp:ListItem>
                                                                    <asp:ListItem Text="Desc" Value="Desc"></asp:ListItem>
                                                                </asp:DropDownList>
                                                            </td>
                                                            <td style="text-align: left">
                                                                <asp:LinkButton ID="btnOK" runat="server" CausesValidation="False"
                                                                    SkinID="linkbutton_8" Text="OK"></asp:LinkButton>
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>
                                                                                                                        
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <telerik:RadGrid ID="grdResult" runat="server" EnableEmbeddedSkins="False" EnableViewState="false" AllowMultiRowSelection="True"
                                            Skin="custom_econcierge" EnableTheming="False"
                                            AllowPaging="True" AllowSorting="true" GridLines="Horizontal"
                                            PageSize="2" Width="640px">
                                            <PagerStyle AlwaysVisible="True" />
                                            <ClientSettings EnablePostBackOnRowClick="True">
                                                <Selecting AllowRowSelect="True" />
                                            </ClientSettings>
                                            <mastertableview>
                                                <rowindicatorcolumn>
                                                    <HeaderStyle Width="20px" />
                                                </rowindicatorcolumn>
                                                <expandcollapsecolumn>
                                                    <HeaderStyle Width="20px" />
                                                </expandcollapsecolumn>
                                                <Columns>
                                                    <telerik:GridButtonColumn CommandName="View" Text="View"
                                                        UniqueName="View" ItemStyle-Width="30px" HeaderStyle-Width="30px" FooterStyle-Width="30px">
                                                        <ItemStyle BackColor="Lavender" ForeColor="Blue" />
                                                    </telerik:GridButtonColumn>
                                                </Columns>
                                            </mastertableview>
                                        </telerik:RadGrid>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </asp:Panel>
                </div>
            </td>
        </tr>
    </table>
 
</asp:Panel>

 

 

Thank you.

3 Answers, 1 is accepted

Sort by
0
Antonio Stoilkov
Telerik team
answered on 26 Mar 2012, 08:54 AM
Hello,

You could achieve your scenario by wrapping your RadGrid in Panel control and setting the EnableViewState to false on the Panel as it is shown below. Note that in some cases RadGrid could not resolve the EnableViewState properly and this kind of approach is needed.
<asp:Panel ID="Panel1" runat="server" EnableViewState="false">
    <telerik:RadGrid ID="grdResult" runat="server" EnableEmbeddedSkins="True"
        AllowMultiRowSelection="True" EnableTheming="True" AllowPaging="True" AllowSorting="true"
        GridLines="Horizontal" PageSize="2" Width="640px">
        <PagerStyle AlwaysVisible="True" />
        <ClientSettings EnablePostBackOnRowClick="True">
            <Selecting AllowRowSelect="True" />
        </ClientSettings>
        <MasterTableView>
            <RowIndicatorColumn>
                <HeaderStyle Width="20px" />
            </RowIndicatorColumn>
            <ExpandCollapseColumn>
                <HeaderStyle Width="20px" />
            </ExpandCollapseColumn>
            <Columns>
                <telerik:GridButtonColumn CommandName="View" Text="View" UniqueName="View" ItemStyle-Width="30px"
                    HeaderStyle-Width="30px" FooterStyle-Width="30px">
                    <ItemStyle BackColor="Lavender" ForeColor="Blue" />
                </telerik:GridButtonColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
</asp:Panel>


Greetings,
Antonio Stoilkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Ravi
Top achievements
Rank 1
answered on 27 Mar 2012, 05:24 AM
Hi Mr.Antonio Stoilkov,
               Thank you for replying to me i did way suggested by you But paging not working..

Thank you,
Ravi.
0
Antonio Stoilkov
Telerik team
answered on 29 Mar 2012, 03:35 PM
Hello Ravi,

I have assembled a sample video showing the RadGrid paging working properly on my side. Additionally, I have attached the updated project.

Please, take a look at it and let me know if there are any differences at your end, which I may be leaving out.

Greetings,
Antonio Stoilkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Ravi
Top achievements
Rank 1
Answers by
Antonio Stoilkov
Telerik team
Ravi
Top achievements
Rank 1
Share this question
or