set_virtualItemCount(count) doesn't work?

4 posts, 0 answers
  1. Elton
    Elton avatar
    98 posts
    Member since:
    Oct 2007

    Posted 09 Oct 2008 Link to this post


    I am trying to do paging with client side data binding.





    but the set_virtualItemCount() doesn't have any effect at all. On the footer it always give me Page 1 at all.
    I tried the example on your site it works fine.

    Just wonder if you can give us some hints on this issue, like what attribute we should turn on, or what event handler we should implement?

    Thank you very much,


  2. Nikolay Rusev
    Nikolay Rusev avatar
    2287 posts

    Posted 14 Oct 2008 Link to this post

    Hello Elton,

    You can find working example here. And it seems to be working.
    Can you show us a little bit of your code?

    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Brett Howard
    Brett Howard avatar
    4 posts
    Member since:
    Feb 2007

    Posted 21 Nov 2008 Link to this post

    We are having a similar issue with the .set_virtualItemCount() which causes an exception everytime we try to set the property.

    tableView.set_virtualItemCount(e.TotalRowCount); //Here is where the exception is generated. In the debugger we get the following exception : Microsoft JScript runtime error: Sys.ArgumentUndefinedException: Value cannot be undefined.
    Parameter name: id

    Does anyone know why this is happening.
    Below is the sample markup.

    Additional Info :
    The tableView.set_virtualItemCount() method throws an exception if we provide any int value.
    The data is able to bind as long as we do not set this property.

    .NET 3.5



    <telerik:RadGrid ID="RadGrid1" AutoGenerateColumns="false" runat="server">


















    <telerik:GridBoundColumn DataField="NewId" SortExpression="NewId" HeaderText="Id"></telerik:GridBoundColumn>






    <telerik:GridBoundColumn DataField="FirstName" SortExpression="FirstName" HeaderText="First Name"></telerik:GridBoundColumn>






    <telerik:GridBoundColumn DataField="LastName" SortExpression="LastName" HeaderText="Last Name"></telerik:GridBoundColumn>






    <telerik:GridBoundColumn DataField="DOB" SortExpression="DOB" DataType="System.DateTime" HeaderText="Date of Birth"></telerik:GridBoundColumn>

















    No Records Available





















    <ClientEvents OnCommand="RadGrid1_Command" />



















    <script type="text/javascript" >








    function LoadGridData()




    var pageSize = $get("<%= ddPageSize.ClientID %>").value;



    var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView();



    var currentPageIndex = tableView.get_currentPageIndex();



    var sortExpressions = tableView.get_sortExpressions().toString();




    var gridPageSize = tableView.get_pageSize();



    "", "", gridPageSize, 1, OnLoadDataSuccess, OnLoadDataFailed);





    function OnLoadDataSuccess(e)




    var grid = $find("<%= RadGrid1.ClientID %>");



    if (grid != null)




    var tableView = grid.get_masterTableView();



    tableView.set_virtualItemCount(e.TotalRowCount); //Here is where the exception is generated. In the debugger




Back to Top