This is a migrated thread and some comments may be shown as answers.

VirtualItemCount

1 Answer 842 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Chris G
Top achievements
Rank 1
Chris G asked on 29 May 2008, 04:56 AM
http://www.telerik.com/help/aspnet/grid/radgrid-telerik.webcontrols.gridtableview-virtualitemcount.html

I am having some issues getting custom paging to work with my RadGrid and in my searches came across the above link.

Possibly I'm reading it incorrectly but it seems like there are a number of conflicting statements on that page.

I believe it is the property I need to set to inform the RadGrid of how many total records can be displayed in the Grid. (Using custom paging my datasource will only ever have the 10 or 15 - pageSize dependent - objects that I am displaying at any given time). For example if I am displaying search results in a RadGridand there are 100 items matching the search criteria, but my PageSize is set to 10. Then I need to set the VirtualItemCount of the RadGrid to 100 so that it knows there are 100 records that can be displayed, even though my datasource will only be populated with 10 at a time.

Can I please get some clarification that my understanding is correct? It would also be nice if that page could be cleaned up as, at least in my opinion, its not currently very helpful.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Veli
Telerik team
answered on 02 Jun 2008, 08:27 AM
Hi Chris G,

Yes, you are correct. In any case, RadGrid will not show more items than indicated by the value of VirtualItemCount property. If this value is larger than the PageSize set for the table, RadGrid will show PageSize items at a time, totaling to VirtualItemCount items. And if your data source has less items than indicated by VirtualItemCount, the number of pages available will be preserved, only the last some of them will contain no items.

Regards,
Veli
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Grid
Asked by
Chris G
Top achievements
Rank 1
Answers by
Veli
Telerik team
Share this question
or