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

Paging radgrid telerik table that contains parent and child in C#

1 Answer 49 Views
Documentation and Tutorials
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Daniel asked on 08 Aug 2014, 08:19 AM
How to have multiple VirtualItemCount in radgrid? In my radgrid table that have a hierarchy structure. It has a parent and child and child below child. I want paging in radgrid differ based on the level. I am already paging the parent, but the problem is the child paging also follow the parent page. Example:

Image below shows that POST contains 8 items and has 2 pages. It is correct, but the COMMENTS's paging also follow the post one. It is wrong. Actually the comments for that post only contain 2 items and the page for comment should have only one.'To calculate the total items of post by this code:
 protected void countData()
string sql = "SELECT * FROM VIEW_POST";
DataTable dtTotalData;
objDBInterface.strConn = mag.ConnStr();
dtTotalData = objDBInterface.getResults(sql);
totalDataIs = dtTotalData.Rows.Count.ToString();
VirtualItemCount = Convert.ToInt16(totalDataIs.ToString());
pageNeeded = Convert.ToInt16(totalDataIs) / FBGrid.PageSize;
And set the radgrid VirtualItemCount by this code on page load:
FBGrid.VirtualItemCount = VirtualItemCount;

Please anybody help me how to handle this situation. Thanks in advance.

1 Answer, 1 is accepted

Sort by
Konstantin Dikov
Telerik team
answered on 12 Aug 2014, 01:14 PM
Hello Daniel,

Although the provided information is not sufficient enough, please note that if you are using DetailTables for the hierarchy, in order to get the pagers to work correctly you need to set the VirtualItemCount (and the other related to the custom paging properties) for the TableViews (MasterTableView and GridTableView) and not for the grid. This will allow you to specify different values to each table view.

If the above does not help, please elaborate on your exact scenario and how you are creating your hierarchy.

Konstantin Dikov

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Documentation and Tutorials
Asked by
Top achievements
Rank 1
Answers by
Konstantin Dikov
Telerik team
Share this question