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

Virtual scrolling and paging Scroll bar position

4 Answers 170 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Antony
Top achievements
Rank 1
Antony asked on 09 Mar 2009, 02:48 PM
Hello.

I've implemented paging and it works great, however,  when I use the scroll bar to change the page the scroll bar position always goes back to the second/third page position. Below is my OnCommand method that deals with changing the page.

args.set_cancel(true);  
          
        var commandArg = args.get_commandArgument();  
                
        if(commandArg == 'Next')  
            thisSession.Grid.Page += 1;  
        else if(commandArg == 'Prev')  
            thisSession.Grid.Page -= 1;  
          
        if(thisSession.Grid.Page == 0) thisSession.Grid.Page = 1;  
          
        thisSession.Grid.Page = sender.get_masterTableView().get_currentPageIndex() + 1;  
          
        if(args.get_commandName() == "Sort")  
        {  
            thisSession.Grid.SortExpression = sender.get_masterTableView().get_sortExpressions();  
            var tsContent = $find('<%=tsContent.ClientID %>');  
            if(!tsContent) return;  
              
              
              
              
              
        }  
          
        var tsContent = $find('<%=tsContent.ClientID %>');  
        if(!tsContent) return;  
        var searchID = tsContent.get_selectedTab().get_value();  
          
        //getSearch(searchID);  
        var searchText = (thisSession.Grid.SearchText == null) ? '' : thisSession.Grid.SearchText;  
        PAB3.GetSearch(searchID.substring(4),thisSession.Grid.Days,  
        thisSession.Grid.Page,thisSession.Grid.PageSize,thisSession.Grid.SortExpression, thisSession.Grid.SearchType,searchText,  
        updateGrid_Paging,function(e){alert(e.get_message());}); 

4 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 11 Mar 2009, 10:49 AM
Hi Antony,

When scrolling with the virtual scroll bar, RadGrid can use either standard postbacks or AJAX requests (when AJAX callbacks are enabled using RadAjaxManager, RadAjaxPanel, or MS UpdatePanel

To enable virtual scrolling for browsing large record sets,

  1. Set the ClientSettings.Scrolling.AllowScroll and ClientSettings.Scrolling.EnableVirtualScrollPaging properties to True.
  2. Set the AllowPaging and AllowCustomPaging properties to True. Set the VirtualItemCount property to the total number of records in the data source.
  3. Bind the grid using the NeedDataSource event, and in the event handler, use the CurrentPageIndex property to determine which subset of the records to fetch

Find more information about virtual scrolling in the following links:
Virtual Scrolling-Demo
Virtual Scrolling-Help topic

I hope this helps.

Regards,

Pavlina

the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Antony
Top achievements
Rank 1
answered on 12 Mar 2009, 11:19 AM
Hi,

I am using a webservice to get my data and I am then binding the data on the client. Is it still possible to use VirtualScrollPaging?

At the moment I am changing the page with in the OnCommand event handler


Thanks,

Antony
0
Rosen
Telerik team
answered on 16 Mar 2009, 02:10 PM
Hi Antony,

Indeed you can use VirtualScrollPaging in combination with client-side databinding. I have attached a small application which demonstrates the functionality in question.

Best wishes,
Rosen
the Telerik team


Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
bharath
Top achievements
Rank 1
answered on 24 Oct 2016, 01:44 PM

Hi,

 i am using radgrid virtual scrolling with intial page size of 25 records out of 500. i am doing color for rows in radgrid_prerender method.when page loads it's fine with first 25 records(rows are colored as expected).but when i scroll after 25 records colors for rows are not coming(prerender method is not firing).

how can i achieve the above scenario.

/Thanks

Bharath

Tags
Grid
Asked by
Antony
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Antony
Top achievements
Rank 1
Rosen
Telerik team
bharath
Top achievements
Rank 1
Share this question
or