On the bottom right hand side of the pager is the text that says, for example, "100 records in 4 pages". What I would like to do is changes this to say 75 records in 3 pages even if there are 100 records. The reason I want to do such an odd thing is that in some instances, there are 100 records, but 75 of them are parents, and 25 are children. I only want the parent records to be displayed in the "X records in Y pages" string. Is this possible?
I've tried the code in http://www.telerik.com/help/aspnet-ajax/grid-accessing-default-pager-buttons.html:
When I run through the code, I get an exception - "Object reference not set to an instance of an object." - at the "pageOfLabel.Text..." line.
Thank you,
Scott
I've tried the code in http://www.telerik.com/help/aspnet-ajax/grid-accessing-default-pager-buttons.html:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item is GridPagerItem) { GridPagerItem item = e.Item as GridPagerItem; Label pageOfLabel = e.Item.FindControl("PageOfLabel") as Label; pageOfLabel.Text = "OF " + item.Paging.PageCount.ToString(); } }
When I run through the code, I get an exception - "Object reference not set to an instance of an object." - at the "pageOfLabel.Text..." line.
Thank you,
Scott