I have a question about the RadGrid when you use both paging and grouping. If all the groups are expanded it works fine. But if i collapse a couple of groups, the rowcount of the group are still counted as if they where expanded?
For instance if I have 5 groups with 10 rows each and a pagesize of 20. When I start the page all the groups are expanded, and the first page is shown with 2 groups of 10 rows each. That is good beacuse I want to show 20 rows on each page. But then if I have a "Collapse All"-button that I press, there is only 2 rows showing on my first page? The 2 groups collapsed is only 2 rows but is counted as if thay where expanded?
Is there any way to solve this? I want the page to show as much data as I have set in the pagesize.
This is my grid (I have tried both Client and Server GroupLoadMode):
<telerik:RadGrid ID="RadGridBuyWarrants" runat="server"
OnNeedDataSource="RadGridBuyWarrants_NeedDataSource" AutoGenerateColumns="false"
AllowSorting="true" AllowPaging="true" PageSize="20"
ShowGroupPanel="false" onitemcommand="RadGridBuyWarrants_ItemCommand"
onitemdatabound="RadGridBuyWarrants_ItemDataBound">
<PagerStyle Mode="NumericPages" />
<ClientSettings AllowGroupExpandCollapse="True" AllowDragToGroup="True" AllowColumnsReorder="True"/>
<MasterTableView Width="100%" GroupLoadMode="Server">
This is my expand/collapse all code:
foreach (GridItem item in RadGridBuyWarrants.MasterTableView.Controls[0].Controls)
{
if (item is GridGroupHeaderItem)
{
item.Expanded =
true;
}
}
Would be very greatful if anyone could help me solve this.
7 Answers, 1 is accepted
Due to the current implementation of the RadGrid control this functionality could not be implemented. However, you could achieve the desired functionality by using our new RadTreeList control.
Please excuse us for the inconvenience this might cause you.
Best wishes,
Pavlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
ok, the treeview seems to have the right functionality.
But to get it to work I have to make big modifications on my datasource? It has to be in parent/child format? And if I want aggregations in the header I have to do them manually before it is databound? So that the parent has calculated data on the parent-level of the datasource?
RadTreeList is used to display self-hierarchical data in a grid style. When configuring it, you need to set the DataKeyNames and the ParentDataKeyNames properties. Please, refer to the help article below for more information about the treelist structure:
Regarding aggregates, note that calculated total values can only be displayed in the footer item at the end of each level.
http://demos.telerik.com/aspnet-ajax/treelist/examples/columns/aggregates/defaultcs.aspx
All the best,
Pavlina
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Appreciate any response.
Thanks,
Arati
Are you talking about the behaviour which is described in the first post of the forum thread? If so, note that with the current implementation of RadGrid control this is not possible. For more information on the subject you can refer to the forum thread below:
http://www.telerik.com/community/forums/aspnet-ajax/grid/collapsing-group-collapses-all-items.aspx
Kind regards,
Pavlina
the Telerik team
For instance if I have 15 groups with 1- 300 rows each, a pagesize of 50, across 63 pages. When I start the page all the groups are expanded, and the first page is shown with 2 groups, with rows continuing onto the next page. But when I start collapsing groups, the first page only has 2 rows for each group header. The rest of the first page is blank, and I still have 63 pages. If I collapse all, I would expect to see a continuous list of group headings.
Is there any way to solve this? I want the page to show as many group heading rows as I have set in the pagesize.
The required functionality is not supported by the RadGrid control. Grouping could be applied only on the items rendered on the current page. As you noticed when you start collapsing groups, the first page only has 2 rows for each group header, this is so because the items on the next pages are not available at this time and they can not be displayed on the first page. This behavior depends on the RadGrid implicit grouping logic and currently there are no scheduled plans to modify this behavior.
Please excuse us for the inconvenience caused.
Regards,
Pavlina
Telerik
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.