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

Grid Disappears When paging/sorting

4 Answers 363 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Andrew
Top achievements
Rank 1
Andrew asked on 29 Feb 2012, 02:38 AM
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>




4 Answers, 1 is accepted

Sort by
0
Andrew
Top achievements
Rank 1
answered on 01 Mar 2012, 09:38 PM
Any ideas on this one?  I still have yet to resolve the issue
0
Pavlina
Telerik team
answered on 02 Mar 2012, 11:28 AM
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.
0
Andrew
Top achievements
Rank 1
answered on 02 Mar 2012, 03:27 PM
Thanks Pavlina, 

I acutally just found that piece last night, I made the change and it now seems to be working.
0
Season
Top achievements
Rank 1
answered on 07 Aug 2017, 10:45 AM

Hi Andrew,

Kindly give your solution!

Thanks

Anand

Tags
Grid
Asked by
Andrew
Top achievements
Rank 1
Answers by
Andrew
Top achievements
Rank 1
Pavlina
Telerik team
Season
Top achievements
Rank 1
Share this question
or