看起来您正在使用IncrementalLoadingCollection
这是需要手动增量加载的默认实现。如果您不希望用户单击第一个块的“加载更多行”,则可以简单地将第一个数据块代码加载到LoadMoreItemsAsync
方法后面。例如,后面
<telerikGrid:RadDataGrid
x:Name="grid"
IncrementalLoadingMode="Explicit"
ItemsSource="{Binding}" />
代码:
private void Page_Loaded(object sender, RoutedEventArgs e)
{
IncrementalLoadingCollection<Data> collection = new IncrementalLoadingCollection<Data>(
async count =>
{
return (from c in Enumerable.Range(0, 10)
select new Data { Category = "Name " + c }).ToList();
})
{ BatchSize = 100 };
this.DataContext = collection;
collection.LoadMoreItemsAsync(10);
}
更多细节请参考this article。
它不应该像这样。请分享您的代码。 – Jessica