title: ToDataSourceResult Extension not populating DataSourceResult object
body: <p>The extension method that KendoUI adds (ToDataSourceResult), seems to fail on Pages > Page #1. It works fine the first time the page loads, but then when I try to use it with virtual scrolling, to fetch pages, 2,3,4 ... N asynchronously, the method ignores all the data in the IEnumerable object I am trying to transform.</p>
  
  <p>My code is as follows:</p>
  
  <p>I have a MVC controller that fetches data like so:</p>
  
  <pre><code>Database database = Database.GenerateDatabase();
  ResultSet queryResults = database.GetEvents( 
      FilterHelper.GenerateQueryCriteria((List&lt;IFilterDescriptor&gt;) request.Filters, request.Page, request.PageSize) 
  );
  </code></pre>
  
  <p>Database.GetEvents returns an object like so:</p>
  
  <pre><code>public class ResultSet {
  
      public List&lt;ResultSetRow&gt; Set;
      public int PageRowCount;
      public int TotalRecordCount;
  }
  </code></pre>
  
  <p>Each ResultSetRow, is an instance of a class that has 1 string, and 2 ints as properties.</p>
  
  <p>At this point, I set a break point and inspect the contents of ResultSet.Set. The database is properly populating the List with as many records as I specified with request.PageSize. I have confirmed that results are being returned for any and all page numbers.</p>
  
  <p>The next stage, everything goes badly:</p>
  
  <pre><code>DataSourceResult result = ((IEnumerable&lt;ResultSetRow&gt;) queryResults.Set).ToDataSourceResult(request);
  </code></pre>
  
  <p>I inspect the contents of the DataSourceResult object, and its array property 'Data' is empty.</p>
  
  <p><strong>Why is my model (ResultSetRow), failing to convert to Kendo's DataSourceResult object?</strong></p>
  
  <p>Some additional info:</p>
  
  <ul>
  <li>Aggregates, groups, sorts, and filters are not being used.</li>
  <li>The number of results returned by Database.GetEvents matches the size of the page requested.</li>
  </ul>
  
  <p>Thanks for your help SO community</p>