简体   繁体   English

基础设施网格选择

[英]Infragistics Grid Selection

I am using Infragistics Grid in my web application.我在我的 Web 应用程序中使用 Infragistics Grid。 I have checkbox inside a template field.我在模板字段中有复选框。 My grid has a paging too.我的网格也有分页。 when I do selection of some rows and go to next page my selection is not persisting.当我选择一些行并转到下一页时,我的选择不会持续存在。 Is there any property which we need to set?.有什么我们需要设置的属性吗? Also I saw that there is Row Selection property but in my case I have a checkbox control inside my grid.我还看到有 Row Selection 属性,但在我的情况下,我的网格中有一个复选框控件。 How to maintain my selection over paging.?如何保持我对分页的选择。?

There is no property which persists selection in the WebDataGrid for pages that are currently not loaded.对于当前未加载的页面,没有在WebDataGrid持久选择的属性。 This is so because the WebDataGrid paging is entirely performed on the server-side and the grid is rebound every time the current page index is changed.之所以如此,是因为WebDataGrid分页完全在服务器端进行,并且每次当前页面索引更改时都会WebDataGrid网格。 The old row objects are disposed and new row objects for the current page are created.旧的行对象被释放,并为当前页面创建新的行对象。 Implementation is such for performance reasons.出于性能原因,实现是这样的。

In order to persist selection, you would have to do a little bit of custom implementation.为了保持选择,您必须进行一些自定义实现。 Keep track of the key of your selected row in code behind, and every time the grid is rebound, check whether the key is present in the current row collection and mark the row as selected.在后面的代码中跟踪你选择的行的键,每次网格反弹时,检查键是否存在于当前行集合中,并将该行标记为选中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM