关于分页的一些问题 [英] A few questions about paging

查看:90
本文介绍了关于分页的一些问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


首先,做得好,Lightswitch令人难以置信!


我想问一些关于分页的问题。


1。我正在使用sql server profiler嗅探,我注意到即使对lightswitch做什么进行分页,也要从另一个选择中选择顶部(x)行 - >这是不是意味着要查询所有数据,然后才会获取前面的
x行?而不只是选择前x行?


2。我试图用不同的(RadDataPager)替换集成的Lightswitch寻呼机,但是这样做有些困难。我试图做的是定义2个自定义控件,1个数据分页器和1个数据网格。我试图使用代码绑定数据
pager。我试图将它绑定到几个不同的东西:


当试图将它绑定到屏幕提供的VisualCollection时,我必须在绑定它之前调用Load函数 - >这使它无用。 Load加载所有对象非分页。这是一个很大的性能影响。


当尝试将它绑定到DataWorkspace的查询时,使用GetQuery()我得到一个异常,说ExecutingObject已经在执行。但是,如果我尝试调用ToList()或类似的东西,它的工作原理。但是再次失去了这一点,
调用ToList使得它没有被分页。


 


想法?


谢谢!

解决方案

我能够让LS使用来自Telerik的RadDataPager和RadGridView。 / p>

关闭LS集合上的分页,然后将RadDataPager Source绑定到LS"Screen.YourCollection"。

$
On您的网格,将项目源绑定到您的RadDataPager - {Binding PagedSource,ElementName = radDataPager}


 


Hi,

First of all, well done, Lightswitch is incredible!

I wanted to ask a few questions about paging.

1. I was sniffing around with the sql server profiler, and I noticed that even with paging on what lightswitch does is to select the top (x) rows out of another select that is full -> doesn't that mean that ALL the data is queried, and only then the top x rows are taken? instead of just selecting the top x rows?

2. I was trying to replace the integrated Lightswitch pager with a different one (RadDataPager), but had some difficulties to do so. what I was trying to do is define 2 custom controls, 1 the data pager, and 1 the data grid. I was trying to bind the data pager using code. I tried to bind it to several different things:

when trying to bind it to the VisualCollection provided by the screen, I had to call the Load function prior to binding it -> which makes it useless. the Load loads all the object Non-paged. which is a big preformance hit.

when trying to bind it to a query from the DataWorkspace, using GetQuery() I got an exception saying that the ExecutingObject is already executing. however if i try to call ToList() or something like that myself it works. but again this loses the point, calling ToList makes it non paged for that matter.

 

Ideas?

Thanks!

解决方案

I was able to get LS working with the RadDataPager and RadGridView from Telerik.

Turn off paging on your LS collection, then bind your RadDataPager Source to the LS "Screen.YourCollection".

On your grid, bind the item source to your RadDataPager - {Binding PagedSource, ElementName=radDataPager}

 


这篇关于关于分页的一些问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆