Hi All -
I just downloaded the latest version of Telerik (Q3 2103)to take advantage of the new Virtualization features in the radgrid. The scrolling works perfectly for 300,000 records! However, I have a GridClientSelectColumn in my grid so that user can chose to select rows by clicking on individual rows, as well as to click the header to "select all". With the virtualization, it can't select all, but selects only those records in the current view. I did notice that the new version does support persisting row selections across pages. I assume this is happening client side (because when I set the items per view to 500+, the performance goes way down).
What's the best way to implement a select all and de-select all for a grid that is virtualized?
Thanks!
Christy
I just downloaded the latest version of Telerik (Q3 2103)to take advantage of the new Virtualization features in the radgrid. The scrolling works perfectly for 300,000 records! However, I have a GridClientSelectColumn in my grid so that user can chose to select rows by clicking on individual rows, as well as to click the header to "select all". With the virtualization, it can't select all, but selects only those records in the current view. I did notice that the new version does support persisting row selections across pages. I assume this is happening client side (because when I set the items per view to 500+, the performance goes way down).
What's the best way to implement a select all and de-select all for a grid that is virtualized?
Thanks!
Christy
1. We can't get Select All to select any more than the records loaded in the current view.
2. We can't get persisting row selections across pages to work. If I select a record on page 1, then virtually scroll down and choose another record on page 20, when I try to do an action on those two records it only affects one of them.
Please advise! We're really looking forward to using virtualization! :)
Thanks,
Adam
I have assembled a sample project showing how the selection of all rows could be achieved. Note that that implementing such behavior is out of the default RadGrid behavior and it workarounds a common virtualization problem.
Regarding your second question: The second behavior is expected because the items on the first and on page 20 are the same (they only change their cell data). You could achieve the desired behavior. However the implementation will be specific to your exact scenario which is not clear from your description. You could try implementing it and if you have any questions related to RadControls to contact us.
Regards,
Antonio Stoilkov
Telerik
DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.
We are trying to implement scroll and virtualization functionalities on a RadGrid with paging. We are trying to do this by getting all the records at one time and by implementing paging on the master table view.
Scrolling Issue:
1. We implemented scroll functionality on the RadGrid like the example below with client side events for row persistance on mulitple pages. It's working as expected, but while scrolling down it's taking few seconds to display the records for the next page:
<Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="300px" EnableVirtualScrollPaging="true" />
<ClientEvents OnRowCreated="RadGrid1_RowCreated" OnRowSelected="RadGrid1_RowSelected" OnRowDeselected="RadGrid1_RowDeselected" />
Virtualization Issue:
2. We implemented virtualization on the same grid like the example below, but here the issue is the grid is not working as expected: the scroller is not moving to the next page when we scroll down. If we comment the clientevents tag, then it works, but we are unable to persist the records on multiple pages and we are unable to select all records (fully all records on all pages not just all records on the current page):
<Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="300px" />
<Virtualization EnableVirtualization="true" ItemsPerView="50" MaxCacheSize="300" />
<ClientEvents OnRowCreated="RadGrid1_RowCreated" OnRowSelected="RadGrid1_RowSelected" OnRowDeselected="RadGrid1_RowDeselected" />
Regarding the scrolling behavior: It is expected to have performance problems when loading a big amount of records for which we have created the Virtualization mechanism.
Regarding the Virtualization issue: The experienced problem is caused from the subscription to the RowCreated event. We are aware of the issue and will fix it as soon as possible. Until then you could subscribe to the RowCreated from the pageLoad event as shown in the example below.
<
ClientSettings
>
<
Scrolling
AllowScroll
=
"true"
UseStaticHeaders
=
"true"
/>
<
Virtualization
EnableVirtualization
=
"true"
/>
<
ClientEvents
OnGridCreated
=
"GridCreated"
/>
</
ClientSettings
>
function
GridCreated(sender) {
sender.add_rowCreated(RowCreated);
}
function
RowCreated() {
}
Regards,
Antonio Stoilkov
Telerik
Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.
It seems like this thread does not really address the issue of selecting rows that are not yet 'in scope'.
This I have accomplished so far only by stopping paging altogether and rebinding, then reselecting.
At that point, of course, the selections are in the selectedItems collection for that unpaginated MasterTableView, but as soon as pagination is reasserted, any items not on the current page are not there any longer.
So I have implemented the several workarounds from Telerik that have been offered for persisting row selections across postbacks and that seems to be behaving.
What I have done now to generate the selection of all rows on the fly is to
Hi Allen,
I have already answered your Support Ticket, but I will share my answer in this forum thread as well.
There are two ways you can display 20K records in the Grid.
First way
The first would be to render all 20K at once. If you do not use Pagination all items will be displayed, however, this would greatly impact the performance because the Server has to render that many items, as well as the Users' browser, has to display them. Both of them take time and are memory hungry.
If you had only 100 items, that would be no problem, and you could have all items selected at once.
Second way
The second way to display items would be by enabling pagination. This is the most optimal approach since the Grid will only render/display the number of items that were set through the PageSize property.
For instance, if you bind 100 records to the Grid, but the page size is set to 10, it will filter the data source by picking 10 records starting from the index of 0 up to the index of 10 and display them. When the second page is selected, the Grid will then use the index of 11 as a starting point and pick 10 more items that will be displayed accordingly.
When filtering, the keywords are used against all 100 items, so it filters the data based on the keywords, but then it will again split that into 10 item pages and render only 10 items at once.
Having that in mind, even if there was an option to select all items across all pages, only the items on the actual page would be rendered and physically selected. The rest of the items would be waiting to be rendered.
By disabling the paging, you tell the Grid to render all the items, however, enabling it again, will only render a portion of it. That is the reason you cannot select all items across all pages without rendering them.
The way you would select all items across all pages would be by setting a global flag in the Session, Cookie, or as a Value to a HidenField that will persist across postbacks. Following the approach from the Persisting the Selected Rows Server-side on Sorting/Paging/Filtering/Grouping to select the Items in the PreRender, you can create a new condition that will check if the Global flag is set, and if so, select the items.
From this point on, regardless of which page you select in the Grid, the items that are to be rendered for that page will be selected anyways. It will behave as if you had all items selected virtually, but only really get selected when rendered.
With the current Grid's implementation, this would be the most efficient and straightforward option to select all items across all pages.