Virtual scrolling and paging Scroll bar position

5 posts, 0 answers
  1. Antony
    Antony avatar
    41 posts
    Member since:
    Jan 2009

    Posted 09 Mar 2009 Link to this post

    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());}); 
  2. Pavlina
    Admin
    Pavlina avatar
    6084 posts

    Posted 11 Mar 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Antony
    Antony avatar
    41 posts
    Member since:
    Jan 2009

    Posted 12 Mar 2009 Link to this post

    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
  5. Rosen
    Admin
    Rosen avatar
    3234 posts

    Posted 16 Mar 2009 Link to this post

    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.
  6. bharath
    bharath avatar
    23 posts
    Member since:
    Jun 2011

    Posted 24 Oct Link to this post

    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

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017