Grid Disappears When paging/sorting

5 posts, 0 answers
  1. Andrew
    Andrew avatar
    4 posts
    Member since:
    Dec 2010

    Posted 28 Feb 2012 Link to this post

    I have a grid that is within a user control.  The user control is dynamically loaded into a panel from an ajaxified rad tree node click.  The grid populates correctly but disappears when I attempt to page or sort by column.  

    I have tried adding a Rad Ajax Proxy Mgr to the user control (SInce I already have an ajax mgr in the master page), as well as attempted to ajaxify the grid from within the user control's page_load event like so:             
    (this.Page.Master as SecuredMasterPage).AddAjaxSetting(this.rgAutoSuggestions, this.rgAutoSuggestions);            

    Neither appear to be working.  I have attempted to read all Telerik Documentation on the matter and believe I am following to the tee.

    Note that the on need data source event is triggered on load but not after including on page or sort.

    User Control Snippet:

          <telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server">
        <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="rgAutoSuggestions">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rgAutoSuggestions" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
     
            <telerik:RadGrid ID="rgAutoSuggestions" runat="server" AllowSorting="true" AllowPaging="true"
            AutoGenerateColumns="false" PageSize="1"
             AllowCustomPaging="true" OnNeedDataSource="rgAutoSuggestions_OnNeedDataSource"
            >
            <PagerStyle Mode="NumericPages" />
            <MasterTableView ViewStateMode="Enabled" DataKeyNames="ListingId">
                <Columns>
                    <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="ListingId" Display="false"
                        DataType="System.Int32" FilterListOptions="VaryByDataType" ForceExtractValue="None"
                        HeaderText="ListingId" ReadOnly="True" SortExpression="ListingId" UniqueName="ListingId">
                    </telerik:GridBoundColumn>
                    <telerik:GridTemplateColumn HeaderStyle-Width="34" ItemStyle-Width="34">
                        <ItemTemplate>
                            <asp:HyperLink ID="InfoLink" runat="server" NavigateUrl="#">
                                <asp:Image ID="InfoImg" runat="server" ImageUrl="~/images/icons/small-info.png" border="0" />
                            </asp:HyperLink>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridImageColumn UniqueName="PrimaryPicture" HeaderText="Primary Picture" />
                    <telerik:GridBoundColumn DataField="ListingId" HeaderText="ListingId" Visible="false" />
                    <telerik:GridBoundColumn DataField="MLSNumber" HeaderText="MLS #" />
                    <telerik:GridBoundColumn DataField="ListPrice" HeaderText="List Price" DataFormatString="{0:C}" />
                    <telerik:GridBoundColumn UniqueName="PropertyAddress" DataField="PropertyAddress" HeaderText="Address" />
                    <telerik:GridBoundColumn UniqueName="City" DataField="City.Name" HeaderText="City" />
                </Columns>
            </MasterTableView>
            <ClientSettings ReorderColumnsOnClient="true" AllowColumnsReorder="true">
                <Resizing AllowColumnResize="true" EnableRealTimeResize="true" ResizeGridOnColumnResize="false" />
            </ClientSettings>
        </telerik:RadGrid>




  2. Andrew
    Andrew avatar
    4 posts
    Member since:
    Dec 2010

    Posted 01 Mar 2012 Link to this post

    Any ideas on this one?  I still have yet to resolve the issue
  3. Pavlina
    Admin
    Pavlina avatar
    6187 posts

    Posted 02 Mar 2012 Link to this post

    Hello,

    Note that after you page is ajaxified with RadAjax, you need to recreate the last loaded control on each Page.Load as described here.

    Greetings,
    Pavlina
    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.
  4. Andrew
    Andrew avatar
    4 posts
    Member since:
    Dec 2010

    Posted 02 Mar 2012 Link to this post

    Thanks Pavlina, 

    I acutally just found that piece last night, I made the change and it now seems to be working.
  5. Season
    Season avatar
    10 posts
    Member since:
    Mar 2014

    Posted 07 Aug 2017 Link to this post

    Hi Andrew,

    Kindly give your solution!

    Thanks

    Anand

Back to Top