or
<telerik:GridDropDownColumn
DataField="Office"
HeaderText="Offices"
UniqueName="chkOffices">
<HeaderStyle Font-Bold="True" HorizontalAlign="Center"/>
<ItemStyle HorizontalAlign="Center" />
</telerik:GridDropDownColumn>
<%
--***********************************************--%>
<telerik:GridDropDownColumn
DataField="TypeName"
HeaderText="Types"
UniqueName="chkTypes">
<HeaderStyle Font-Bold="True" HorizontalAlign="Center"/>
<ItemStyle HorizontalAlign="Center" />
</telerik:GridDropDownColumn>
private void BindDetails(DataTable Details, DataTable List, DataTable TiersList, DataTable officeList)
{
RadGrid grid = radGridPromoDetails;
grid.
MasterTableView.SortExpressions.Clear();
grid.
CurrentPageIndex = 0;
grid.
DataSource = Details;
grid.
DataBind();
}
List<State> stateList = GetStates();uxState.DataSource = stateList;uxState.DataBind();foreach (DropDownListItem item in uxState.Items){ State state = stateList.Find(delegate(State myState) { return myState.StateId == new Guid(item.Value); }); if (state != null) { item.ToolTip = state.Name; }}foreach (State state in List<State>){ DropDownListItem item = new DropDownListItem(state.Abbreviation, state.StateId.ToString()); item.ToolTip = state.Name; uxState.Items.Add(item);}

<system.webServer> <modules runAllManagedModulesForAllRequests="true"> <add name="RadCompression" type="Telerik.Web.UI.RadCompression" /> </modules></system.serviceModel><asp:LoginView ID="HeadLoginView" runat="server" EnableViewState="false"> <AnonymousTemplate> [ <a href="~/Account/Login.aspx" ID="HeadLoginStatus" runat="server">Log In</a> ] </AnonymousTemplate> <LoggedInTemplate> Welcome <span class="bold"><asp:LoginName ID="HeadLoginName" runat="server" /></span>! [ <asp:LoginStatus ID="HeadLoginStatus" runat="server" LogoutAction="Redirect" LogoutText="Log Out" LogoutPageUrl="~/"/> ] </LoggedInTemplate></asp:LoginView>
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; |
| } |
| } |
| } |