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

How to optimize Telerik RadListView?

3 Answers 65 Views
ListView
This is a migrated thread and some comments may be shown as answers.
katcard
Top achievements
Rank 1
katcard asked on 09 Jul 2011, 12:50 PM

Hi, i'm developing a RadListView with a pagination performed by a stored procedure that calculates: page index and items loaded within the RadListView. I've noticed that navigation of the RadListView increase the browser's memory process for each async postback.

How can i reduce this memory unnecessarily occupied?

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 14 Jul 2011, 07:19 AM
Hello Katcard,

I'm afraid there is no easy way to guess what causes this problem judging only by the provided description. Can you post your markup so that we can try to reproduce this?

Regards,
Daniel
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
katcard
Top achievements
Rank 1
answered on 14 Jul 2011, 08:48 AM
I try to explain. There are a master page that contains the search RadControls and a content page that contains RadListViews. There are two RadListView (radListDetail and radListImages). Two ImageButton (ibtDetail and ibtImages) switches respectively the visibility of two aspPanel (panDetailContent and panImagesContent) that contains RadListViews. RadScriptManagerProxy ajaxify the content page:

<telerik:RadAjaxManagerProxy ID="radAjaxManagerContent" runat="server">
        <AjaxSettings>            
            <telerik:AjaxSetting AjaxControlID="ibtDetail">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="panDetailContent" />
                    <telerik:AjaxUpdatedControl ControlID="panImagesContent" />                    
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="ibtImages">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="panDetailContent" />
                    <telerik:AjaxUpdatedControl ControlID="panImagesContent" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="radListDetail">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="radListDetail" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="radListImages">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="radListImages" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
</telerik:RadAjaxManagerProxy>


The radListDetail (one of the two radListViews):
<telerik:RadListView ID="radListDetail" runat="server" AllowPaging="True"
                    AllowCustomPaging="true" PageSize="6" ItemPlaceholderID="plhDetail"
                    CanRetrieveAllData="false" DataKeyNames="Code">
                    <LayoutTemplate>
                        <div class="elenco_paginazione_top">
                            <telerik:RadDataPager runat="server" PagedControlID="radListDetail" PageSize="6">
                                <Fields>
                                    <telerik:RadDataPagerButtonField FieldType="Prev" />
                                    <telerik:RadDataPagerButtonField FieldType="Numeric" />
                                    <telerik:RadDataPagerButtonField FieldType="Next" />
                                    <telerik:RadDataPagerTemplatePageField>
                                        <PagerTemplate>
                                            <div class="to_right">
                                                <asp:Label runat="server" Text="Total Number:" />
                                                <asp:Label runat="server" Text="<%# Container.Owner.TotalRowCount%>" />
                                            </div>
                                        </PagerTemplate>
                                    </telerik:RadDataPagerTemplatePageField>
                                </Fields>
                            </telerik:RadDataPager>
                        </div>
                        <div id="elenco_dettaglio">
                            <asp:PlaceHolder ID="plhDetail" runat="server" />
                        </div>
                        <div class="elenco_paginazione_bottom">
                            <telerik:RadDataPager runat="server" PagedControlID="radListDetail" PageSize="6">
                                <Fields>
                                    <telerik:RadDataPagerButtonField FieldType="Prev" />
                                    <telerik:RadDataPagerButtonField FieldType="Numeric" />
                                    <telerik:RadDataPagerButtonField FieldType="Next" />
                                    <telerik:RadDataPagerTemplatePageField>
                                        <PagerTemplate>
                                            <div class="to_right">
                                                <asp:Label runat="server" Text="Total Number:" />
                                                <asp:Label runat="server" Text="<%# Container.Owner.TotalRowCount%>" />
                                            </div>
                                        </PagerTemplate>
                                    </telerik:RadDataPagerTemplatePageField>
                                </Fields>
                            </telerik:RadDataPager>
                        </div>
                    </LayoutTemplate>
                    <ItemTemplate>
                        <div>
..
</div>
                    </ItemTemplate>
                    <EmptyDataTemplate>
                        <div>
                           ..
                        </div>
                    </EmptyDataTemplate>
                </telerik:RadListView>


Search is performed by a stored procedure that accepts some input parameters including the PageIndex and the PageSize of the radListView. The first time:
int? elements = 0;
   //search begins
   var source = this.Search(parameters, this.radListDetail.CurrentPageIndex, this.radListDetail.PageSize, out elements);
   this.radListDetail.VirtualItemCount = elements.Value;
   this.radListDetail.DataSource = source;
   this.radListDetail.DataBind();

The next time the search is managed by NeedDataSource:
   int? elements = 0;
   //search begins
   var source = this.Search(parameters, this.radListDetail.CurrentPageIndex, this.radListDetail.PageSize, out elements);
   this.radListDetail.VirtualItemCount = elements.Value;
   this.radListDetail.DataSource = source;



0
Daniel
Telerik team
answered on 19 Jul 2011, 08:56 PM
Hello Katcard,

I understand your scenario now, but still I don't know how to reproduce the problem - your setup looks pretty standard so I would recommend that you try to find the problematic component by removing the elements on your page one by one. For example - you can first remove the pagers, then you can try to simplify the ItemTemplate contents, then turn off AJAX and so on until you find what causes the problem.

Kind regards,
Daniel
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
ListView
Asked by
katcard
Top achievements
Rank 1
Answers by
Daniel
Telerik team
katcard
Top achievements
Rank 1
Share this question
or