or
Hi All,
I am not sure if I am pushing the limits of RadGrid here, but below is the code that I am using.
I am trying to do is group the data in the RadGrid by Entity and then by Location, this I have achieved. I would also like to have a sub total per location and then a total per entity.
As I said I get the grouping right, I also get the total by location right, but what seems to be is happening is that total per Entity seems to be the last amount in the location.
Firstly, can I achieve what I am trying to and secondly how.
Thanx
| <telerik:RadGrid ID="RadGridMonthlyReport" runat="server" AllowFilteringByColumn="True" | |
| AllowSorting="True" DataSourceID="objDsMonthlyBillingReportAll" | |
| GridLines="None" Skin="Vista" HorizontalAlign="Left"> | |
| <HeaderContextMenu> | |
| <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> | |
| </HeaderContextMenu> | |
| <ExportSettings OpenInNewWindow="True" ExportOnlyData="True" /> | |
| <MasterTableView ShowGroupFooter="true" AutoGenerateColumns="False" DataSourceID=""> | |
| <RowIndicatorColumn> | |
| <HeaderStyle Width="20px"></HeaderStyle> | |
| </RowIndicatorColumn> | |
| <ExpandCollapseColumn> | |
| <HeaderStyle Width="20px"></HeaderStyle> | |
| </ExpandCollapseColumn> | |
| <Columns> | |
| <telerik:GridBoundColumn DataField="EntityNumber" HeaderText="Entity" SortExpression="EntityNumber" UniqueName="EntityNumber" /> | |
| <telerik:GridBoundColumn DataField="LocationName" HeaderText="Department" SortExpression="LocationName" UniqueName="LocationName" /> | |
| <telerik:GridBoundColumn DataField="ItemName" HeaderText="Item" SortExpression="ItemName" UniqueName="ItemName" /> | |
| <telerik:GridBoundColumn DataField="Total" DataType="System.Decimal" HeaderText="Total" ReadOnly="True" SortExpression="Total" UniqueName="Total" Aggregate="Sum" FooterText="Total: " /> | |
| </Columns> | |
| <GroupByExpressions> | |
| <telerik:GridGroupByExpression> | |
| <GroupByFields> | |
| <telerik:GridGroupByField FieldName="EntityNumber" /> | |
| </GroupByFields> | |
| <SelectFields> | |
| <telerik:GridGroupByField FieldName="EntityNumber" HeaderText="Entity Number" /> | |
| </SelectFields> | |
| </telerik:GridGroupByExpression> | |
| <telerik:GridGroupByExpression> | |
| <GroupByFields> | |
| <telerik:GridGroupByField FieldName="LocationName" /> | |
| </GroupByFields> | |
| <SelectFields> | |
| <telerik:GridGroupByField FieldName="LocationName" HeaderText="Location Name" /> | |
| </SelectFields> | |
| </telerik:GridGroupByExpression> | |
| </GroupByExpressions> | |
| </MasterTableView> | |
| <FilterMenu> | |
| <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> | |
| </FilterMenu> | |
| </telerik:RadGrid> |
| protected void RadGrid1_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) |
| { |
| if ("Detail".Equals(e.Item.OwnerTableView.Name)) |
| { |
| GridBoundColumn packageColumn = (GridBoundColumn)e.Item.OwnerTableView.GetColumnSafe("PackageName") as GridBoundColumn; |
| GridBoundColumn fileIdColumn = (GridBoundColumn)e.Item.OwnerTableView.GetColumnSafe("FileId") as GridBoundColumn; |
| GridBoundColumn connectionStringColumn = (GridBoundColumn)e.Item.OwnerTableView.GetColumnSafe("ConnectionString") as GridBoundColumn; |
| if (e.Item.IsInEditMode && e.Item is IGridInsertItem) |
| { |
| (e.Item as GridEditableItem)["PackageName"].Enabled = true; |
| } |
| if ("InitInsert".Equals(e.CommandName)) |
| { |
| packageColumn.ReadOnly = false; |
| fileIdColumn.ReadOnly = false; |
| connectionStringColumn.ItemStyle.Width = Unit.Pixel(200); //THIS IS THE FIELD I WANT TO CHANGE THE WIDTH OF |
| } |
| else |
| { |
| packageColumn.ReadOnly = true; |
| fileIdColumn.ReadOnly = true; |
| } |
| } |
| } |

using System;using System.Collections.Generic;using System.Linq;using System.Web;using Telerik.Web.UI;namespace TreeViewTest{ public class XTreeView:RadTreeView { }} string xmlStr = @"<Tree> <Node Text='Desktop' Expanded='True' ToolTip='Desktop' ImageUrl='~/TreeView/Img/Vista/desktop.png'> <Node Text='Administrator' ImageUrl='~/TreeView/Img/Vista/folder-personal.png' Expanded='True'> <Node Text='AppData' ImageUrl='~/TreeView/Img/Vista/folder.png'> <Node Text='Microsoft' ImageUrl='~/TreeView/Img/Vista/folder.png'/> </Node> <Node Text='Contacts' ImageUrl='~/TreeView/Img/Vista/folder-contacts.png' /> <Node Text='Downloads' ImageUrl='~/TreeView/Img/Vista/folder-open.png'/> <Node Text='Documents' ImageUrl='~/TreeView/Img/Vista/folder-documents.png' Selected='True' /> <Node Text='Favorites' ImageUrl='~/TreeView/Img/Vista/folder-favorites.png' > <Node Text='Links' ImageUrl='~/TreeView/Img/Vista/folder.png'/> </Node> <Node Text='Music' ImageUrl='~/TreeView/Img/Vista/folder-music.png' /> <Node Text='Pictures' ImageUrl='~/TreeView/Img/Vista/folder-pictures.png' /> <Node Text='Saved Games' ImageUrl='~/TreeView/Img/Vista/folder-open.png' /> <Node Text='Searches' ImageUrl='~/TreeView/Img/Vista/searches.png' > <Node Text='History' ImageUrl='~/TreeView/Img/Vista/folder.png'/> </Node> <Node Text='Videos' ImageUrl='~/TreeView/Img/Vista/folder-videos.png' /> </Node> <Node Text='Computer' ToolTip='My Computer' ImageUrl='~/TreeView/Img/Vista/computer.png' Expanded='True' > <Node Text='WebServer (\\10.0.0.80) (W:)' ImageUrl='~/TreeView/Img/Vista/network-drive.png' /> <Node Text='Local Disk (C:)' ImageUrl='~/TreeView/Img/Vista/system-drive.png' Expanded='True' > <Node Text='inetpub' ImageUrl='~/TreeView/Img/Vista/folder.png' Expanded='True'> <Node Text='AdminScripts' ImageUrl='~/TreeView/Img/Vista/folder.png'></Node> </Node> </Node> </Node> </Node></Tree>"; XTreeView1.LoadXmlString(xmlStr);