Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
119 views
I am using RadTabStrip as a wizard.
On one of the page views I have usercontrol that loads a grid. I calculate the footer total on one of the columns in ItemDatabound event.
If I move to a previous tab and then come back to the tab with the grid, I notice that my Itemdatabound event is called twice and henece my total gets doubled up.

I can't figure out why the ItemdataBound event is fired twice.

<%@ Page Language="C#" MasterPageFile="~/enrollment/enrollmentWizard.master" AutoEventWireup="true"
    CodeFile="EDCP.aspx.cs" Inherits="enrollment_theCompany_EDCP" Title="M Benefit Solutions: The Comapny Enrollment" %>
 
<%@ MasterType VirtualPath="~/enrollment/enrollmentWizard.master" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<%@ Register TagPrefix="iSys" TagName="summary" Src="~/enrollment/ucEnrollmentSummary.ascx" %>
<%@ Register TagPrefix="iSys" TagName="fundBucket" Src="~/fund/ucFundbucket.ascx" %>
<%@ Register TagPrefix="iSys" TagName="deferralElections" Src="~/enrollment/thecompany/deferralElections.ascx" %>
<%@ Register TagPrefix="iSys" TagName="paymentOptions" Src="~/enrollment/thecompany/paymentOptions.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    <telerik:RadAjaxManagerProxy ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="rmpEnrollment">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rtsEnrollment" />
                    <telerik:AjaxUpdatedControl ControlID="rmpEnrollment" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="rtsEnrollment">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="rtsEnrollment" />
                    <telerik:AjaxUpdatedControl ControlID="rmpEnrollment" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    <table cellpadding="0" cellspacing="0" width="100%">
        <tr>
            <td>
                <telerik:RadTabStrip ID="rtsEnrollment" runat="server" MultiPageID="rmpEnrollment"
                    OnTabClick="rtsEnrollment_TabClick" SelectedIndex="0" CausesValidation="true"
                    Align="Justify" AutoPostBack="true">
                </telerik:RadTabStrip>
                <telerik:RadMultiPage ID="rmpEnrollment" runat="server" SelectedIndex="0" OnPageViewCreated="rmpEnrollment_PageViewCreated"
                    OnPreRender="rmpEnrollment_PreRender" RenderSelectedPageOnly="true" CssClass="multiPage">
                </telerik:RadMultiPage>
            </td>
        </tr>
    </table>
</asp:Content>
 
aspx.cs
 
public partial class enrollment_theCompany_EDCP : EnrollmentBasePage
{
    protected override void LoadStep()
    {
        string tabName = rtsEnrollment.SelectedTab.Text;
        RadTab tab = rtsEnrollment.FindTabByText(tabName);
 
        switch (rtsEnrollment.SelectedTab.Text)
        {
            case "Deferral Elections":
                break;
 
            case "Distribution Elections":
                break;
 
            case "Fund Allocations":
                RadPageView pvFundAllocations = (RadPageView)tab.PageView.FindControl("fundAllocations");
                ucFundBucket ucFundAllocations = (ucFundBucket)pvFundAllocations.FindControl("ucFundAllocations");
                ucFundAllocations.LoadPlan();
                break;
 
            case "Enrollment Summary":
                // commit data
                break;
        }
    }
 
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            AddTab("Deferral Elections", true);
 
            RadPageView pageView = new RadPageView();
            pageView.ID = "DeferralElections";
            rmpEnrollment.PageViews.Add(pageView);
 
            AddTab("Distribution Elections", false);
            AddTab("Fund Allocations", false);
            AddTab("Enrollment Summary", false);
 
            LoadStep();
        }      
    }
 
    #region UI Events
 
    protected void rmpEnrollment_PreRender(object sender, EventArgs e)
    {
        LoadStep();
    }
 
    protected void rmpEnrollment_PageViewCreated(object sender, RadMultiPageEventArgs e)
    {
        Control pageViewContents = new Control();
        //code
    }
    protected void rtsEnrollment_TabClick(object sender, RadTabStripEventArgs e)
    {
        Page.Validate(rtsEnrollment.ValidationGroup);
        if (Page.IsValid)
            rtsEnrollment.ValidationGroup = e.Tab.Value;
 
        LoadStep();       
    }
    protected void PreviousButton_Click(object sender, EventArgs e)
    {
    }
    protected void ContinueButton_Click(object sender, EventArgs e)
    {
    }
    protected void FinishButton_Click(object sender, EventArgs e)
    {
    }   
    #endregion
}
 
.ascx for Fund Allocations
 
<%@ Control Language="c#" Inherits="iSys.fund.ucFundBucket" CodeFile="ucFundbucket.ascx.cs" %>
<%@ Register TagPrefix="iSys" TagName="pieChart" Src="~/Common/ucPieChart.ascx" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<table width="100%" cellspacing="0" cellpadding="0" border="0">
    <telerik:RadAjaxManagerProxy ID="RadAJAXManagerProxy1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="rgFunds">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="_successfulPostMessage" />
                    <telerik:AjaxUpdatedControl ControlID="rgFunds" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="_fundsPanel" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManagerProxy>
    <asp:PlaceHolder ID="_allocationPanel" runat="server">
        
        <asp:PlaceHolder ID="_fundsPanel" runat="server" Visible="true">
            <tr valign="top">
                <td align="left" style="width: 50%" rowspan="2">
                    <telerik:RadGrid ID="rgFunds" runat="server" AllowSorting="False" EnableViewState="true" AllowPaging="false"
                         GridLines="Both" AllowMultiRowEdit="true" OnPreRender="rgFunds_PreRender" OnItemDataBound="rgFunds_ItemDataBound"
                        OnItemCreated="rgFunds_ItemCreated" OnItemCommand="rgFunds_ItemCommand" OnNeedDataSource="rgFunds_NeedDataSource">
                        <MasterTableView TableLayout="Fixed" HierarchyDefaultExpanded="true" CommandItemDisplay="Bottom"
                            EditMode="InPlace" EnableNoRecordsTemplate="true">
                            <CommandItemTemplate>
                                <table width="100%">
                                    <tr>
                                        <td colspan="4" align="left">
                                            <asp:CheckBox ID="chkAutoRebalance" runat="server" Visible="false" CssClass="checkbox"
                                                OnCheckedChanged="chkAutoRebalance_CheckedChanged" />
                                        </td>
                                        <td align="right">
                                            <asp:Button ID="btnPostTransaction" runat="server" Text="Post Transaction" CssClass="button"
                                                CommandName="PostTransaction" />
                                        </td>
                                    </tr>
                                </table>
                            </CommandItemTemplate>
                            <Columns>
                                <telerik:GridTemplateColumn ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left"
                                    FooterStyle-HorizontalAlign="Left" UniqueName="InvestmentOptions" ReadOnly="true"
                                    HeaderText="Investment Options">
                                    <ItemTemplate>
                                        <asp:HyperLink ID="_pdfLink" runat="server" ImageUrl="~/App_Themes/Images/pdf_icon.gif"
                                            Visible="false" />
                                        <asp:Label ID="_color" runat="server">    </asp:Label>
                                        <asp:Label ID="_fundName" runat="server" Text='<%# Eval("fundName")%>'></asp:Label>
                                        <asp:CheckBox ID="_excludeFund" runat="server" Checked='<%# Eval("allowRebalanceExclude")%>'
                                            Text="Exclude?" Visible='<%# Eval("allowRebalanceExclude")%>' />
                                        <input type="hidden" id="_fundID" runat="server" />
                                        <input type="hidden" id="_autoRebalanceFlag" runat="server" />
                                        <input type="hidden" id="_allowRebalance" runat="server" />
                                    </ItemTemplate>
                                    <FooterTemplate>
                                        <strong>Total must equal 100%</strong></FooterTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn ItemStyle-HorizontalAlign="Right" HeaderText="Current %"
                                    HeaderStyle-Width="20%" ReadOnly="true" DataField="currentPercent" UniqueName="currentPercent">
                                    <ItemTemplate>
                                        <asp:Label ID="_currentPercent" runat="server" Text='<%# Eval("currentPercent", "{0:N2}%")%>'>
                                        </asp:Label></ItemTemplate>
                                    <%--<FooterTemplate>
                                        <asp:Label ID="fundTotalOld" runat="server" />%
                                    </FooterTemplate>--%>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn ItemStyle-HorizontalAlign="Right" UniqueName="futurePercent"
                                    HeaderStyle-Width="20%" HeaderText="New %">
                                    <ItemTemplate>
                                        <asp:Label ID="_futurePercent" runat="server" Text='<%# Eval("futurePercent", "{0:N2}%")%>'></asp:Label>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtNewPercent" runat="server" CssClass="percent" groupName="allocations"
                                            Width="40px" onchange="SumGroup(this, false)" Text='<%# Eval("futurePercent")%>' />
                                        %
                                        <asp:RangeValidator ID="newPercentageRange" runat="server" ControlToValidate="txtNewPercent"
                                            Type="Integer" CssClass="errormessagesmall" Display="None" />
                                        <asp:CustomValidator ID="newPercentageIncrement" runat="server" ControlToValidate="txtNewPercent"
                                            ClientValidationFunction="Mod_ClientValidate" CssClass="errormessagesmall" Display="None" />
                                        <cc1:ValidatorCalloutExtender ID="newPercentageRangeCallout" runat="server" TargetControlID="newPercentageRange"
                                            Width="235px" />
                                        <cc1:ValidatorCalloutExtender ID="newPercentageIncrementCallout" runat="server" TargetControlID="newPercentageIncrement"
                                            Width="235px" />
                                    </EditItemTemplate>
                                    <FooterTemplate>
                                        <asp:TextBox ID="fundTotal" runat="server" CssClass="percent" onfocus="blur()" Enabled="false"
                                            Font-Bold="true" ForeColor="Black" Width="40px" />
                                        %
                                        <asp:CompareValidator ID="totalEqual100" runat="server" ControlToValidate="fundTotal"
                                            ValueToCompare="100" Operator="Equal" CssClass="errormessagesmall" Display="None"
                                            ErrorMessage="New allocations must total 100%." />
                                        <asp:RequiredFieldValidator ID="fundTotalRequired" runat="server" ControlToValidate="fundTotal"
                                            Display="None" Visible="false" ErrorMessage="You <em>must</em> enter an allocation." />
                                        <cc1:ValidatorCalloutExtender ID="fundTotalRequiredCallout" runat="server" TargetControlID="fundTotalRequired"
                                            Width="235px" />
                                        <cc1:ValidatorCalloutExtender ID="totalEqual100Callout" runat="server" TargetControlID="totalEqual100"
                                            Width="235px" />
                                    </FooterTemplate>
                                </telerik:GridTemplateColumn>
                            </Columns>
                        </MasterTableView>
                    </telerik:RadGrid>
                </td>
            </tr>
        </asp:PlaceHolder>
</table>
 
.ascx.cs
 
    public partial class ucFundBucket : userControl
    {
         
        public void LoadPlan()
        {  
            rgFunds.Rebind();
        }       
 
        /// <summary>
        /// Loads the percents table and the charts
        /// </summary>
        private void DrawPie()
        {
            DateTime today = DateTime.Now;
            DataTable dt;
            DataView dv, dvFuture;
            if (_allocationType == FundAllocation.AllocationType.Rebalance)
            {
                //code
            }
            else
            {
                //code
            }        
 
            // bind to grid
            rgFunds.DataSource = dt;
        }
 
        protected void rgFunds_ItemCommand(object source, GridCommandEventArgs e)
        {
            if (e.CommandName == "PostTransaction")
            {
                //code
            }
        }
 
        protected void rgFunds_PreRender(object source, EventArgs e)
        {
            // only visible if is the actual employee
            btnPostTransaction.Visible = (ShowPostTransactionButton && IsCurrentEmployee);
 
            //Puts the grid in editmode
                foreach (GridItem item in rgFunds.MasterTableView.Items)
                {
                    if (item is GridEditableItem)
                    {
                        GridEditableItem editableItem = item as GridDataItem;
                        editableItem.Edit = true;
                    }
                }
                rgFunds.Rebind();           
 
            // Add the attribute to the fundTotal textbox
            GridItem gridFooterItem = rgFunds.MasterTableView.GetItems(GridItemType.Footer)[0];
            TextBox fundTotal = (TextBox)gridFooterItem.FindControl("fundTotal");
 
            GridItem[] gridEditItem = rgFunds.MasterTableView.GetItems(GridItemType.EditItem);
            if (gridEditItem.Count() > 0)
            {
                foreach (GridItem item in gridEditItem)
                {
                    TextBox txtNewPercent = item.FindControl("txtNewPercent") as TextBox;
                    txtNewPercent.Attributes.Add("totalName", fundTotal.ClientID);
                }
            }
        }
 
        protected void rgFunds_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            DrawPie();
        }
 
        protected void rgFunds_ItemCreated(object sender, GridItemEventArgs e)
        {
           //code
        }
 
        protected void rgFunds_ItemDataBound(object source, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem && e.Item.IsInEditMode)
            {
                GridDataItem item = (GridDataItem)e.Item;
                DataRowView view = (DataRowView)item.DataItem;
                
                //some code      
 
                TextBox txtNewPercent = (TextBox)item["futurePercent"].FindControl("txtNewPercent");
                string newPercent = txtNewPercent.Text.Replace("%", "");               
 
                _futureTotals += Double.Parse((newPercent == "") ? "0" : newPercent);
            }
            if (e.Item is GridFooterItem )
            {
                GridFooterItem footerItem = (GridFooterItem)e.Item;              
 
                TextBox fundTotal = (TextBox)footerItem["futurePercent"].FindControl("fundTotal");
                fundTotal.Text = (_futureTotals > 0) ? _futureTotals.ToString() : "";
 
                // require a future allocation if previous is zero
                RequiredFieldValidator fundTotalRequired = (RequiredFieldValidator)footerItem["futurePercent"].FindControl("fundTotalRequired");
                fundTotalRequired.Visible = ((_allocationType == FundAllocation.AllocationType.Future) && (_currentTotals == 0));              
            }
        }
    }
}


Nencho
Telerik team
 answered on 19 Jun 2014
1 answer
85 views
I have a dropdown in which when i select item from dropdown ,the cursor remains there on dropdown i dont want this to happen.


Please Suggest
Princy
Top achievements
Rank 2
 answered on 19 Jun 2014
4 answers
131 views
Where us the documentation and demos for using radpaging ???
Ivan Zhekov
Telerik team
 answered on 19 Jun 2014
5 answers
1.2K+ views
Hi,
I have a problem and would appreciate your help.

I would like to show on a HTML Pie Chart two values: the actual value (units) and a percentage (%).
So for example in such format: 35% (120units)  or  20% (110units) and so on. This should appear as a PieLabel and additionally as Tooltip (when someone moves cursor over pie).
For each data I have counted both values.

I prefer the programmatic creation of chart :) (in .aspx only the minimum)

So my code looks like:

chart.aspx:
<telerik:RadHtmlChart runat="server" ID="RadHtmlChart1" Width="500" Height="500"
    Transitions="true">
    <Appearance>
        <FillStyle BackgroundColor="White" />
    </Appearance>
    <Legend>
        <Appearance BackgroundColor="White" Position="Right" Visible="true" />
    </Legend>
    <PlotArea>
        <Appearance>
            <FillStyle BackgroundColor="White" />
        </Appearance>
        <Series>
        </Series>
    </PlotArea>
</telerik:RadHtmlChart>


chart.aspx.cs:
private void ShowChart()
{
    PieSeries pieSeries = new PieSeries();
       
 
        listContactsAmount = report.GetCampaignData(iCampaignId); // get my data
 
        if (listContactsAmount != null && listContactsAmount.Count > 0)
        {
            int sum = 0;
            foreach (DataRow row in listContactsAmount.Rows)
            {
                sum = sum + (int)row["ContactsAmount"]; 
            }
 
            pieSeries.StartAngle = 90;
            pieSeries.LabelsAppearance.DataFormatString = "{0}";
            pieSeries.LabelsAppearance.Position = Telerik.Web.UI.HtmlChart.PieLabelsPosition.Circle;
            pieSeries.TooltipsAppearance.DataFormatString = "{0}";
            
            SeriesItem seriesItem = null;
 
            foreach (DataRow row in listContactsAmount.Rows)
            {
                seriesItem = new SeriesItem();
 
                string contactsStatus = (string)row["ContactsStatus"];
 
                int contactsAmount = (int)row["ContactsAmount"]; // the first value to display
                decimal percentage = Math.Round(Decimal.Divide((decimal)contactsAmount, (decimal)sum), 4); // the second value to display - WHERE PUT IT ?
 
                seriesItem.Name = contactsStatus;
                seriesItem.YValue = contactsAmount;
 
                if (contactsStatus.Equals("Ok"))
                {
                    seriesItem.BackgroundColor = Color.GreenYellow;
                    seriesItem.Exploded = true;                       
                }
                else
                {
                    seriesItem.BackgroundColor = Color.Red;
                    seriesItem.Exploded = true;
                }
 
                pieSeries.Items.Add(seriesItem);
            }
 
            RadHtmlChart1.PlotArea.Series.Add(pieSeries);
        }
}
Tom
Top achievements
Rank 2
 answered on 19 Jun 2014
3 answers
125 views
function checkEnter() {
if (navigator.userAgent.indexOf('Firefox') !== -1 || navigator.userAgent.indexOf('Chrome') !== -1) {

if (event.keyCode === 13) {
var grid = $find("<%= rgClaimLines.ClientID %>");
if (grid) {
var EditItems = grid.get_editItems();
for (var i = 0; i < EditItems.length; i++) {
var editItem = EditItems[0];
var textBox = $(editItem.get_editFormItem()).find("input[id*='ddl_Paid']").get(0);
textBox.focus();
event.preventDefault();
return false;
}
}

The above function works perfectly on the first row of my grid, but fails on any subsequent rows....

Any ideas?

Regards
Marius

 }

}
Marius
Top achievements
Rank 1
 answered on 19 Jun 2014
4 answers
813 views
hi guys , hope u all doing fine , I really LOVE telerik it is amazing !! best job ever !! but I have a problem in my RadAsyncUpload :( , I have created a web application , it all works fine in my localhost , but when i upload it into my Host the RadAsyncUpload doesn't work !! it doesn't upload the file while in my localhost it uploads files and save it to the target folder and i get name and whatever i want from uploaded files !!
in the first two attached pics i showed what exactly happen and the end pic is the code .
Version : RadControls for ASP.NET AJAX Q2 2012
NOTE : I haven't use RadProgressArea or anything , what you see in the last pis is all which is the RadAsyncUpload alone .
Thank u so much for answering and helping :)

Peter Filipov
Telerik team
 answered on 19 Jun 2014
1 answer
221 views
Hi,

I've recently switched a site over tot he RadAsyncUpload module.  It works fine in my local development environment.  When I later go and install it in a testing environment I'm getting the an error message that states "Telerik.Web.UI.RadAsyncUpload does not implement IHttpModule".  I can't find anything online that addresses this specific error message.  Note that I'm deploying a precompiled web app.

My web config contains the following relevant keys:


<httpModules>
   <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule">
</httpModules>
<system.webServer>
   <modules runAllManagedModulesForAllRequests="true">
      <remove name="RadAsyncUpload" />
      <add name="RadAsyncUpload" type="Telerik.Web.UI.RadAsyncUpload" preCondition="integratedMode" />
      <remove name="RadCompression" />
      <add name="RadCompression" type="Telerik.Web.UI.RadCompression" preCondition="integratedModle" />
   </modules>
</system.webServer>


Any thoughts or guidence would be greatly appreciated.
Nencho
Telerik team
 answered on 19 Jun 2014
1 answer
112 views
Hi,
I have a treeview and a textbox for search. I am able to get the searched node from the treeview. But I need to expand all the ancestors of that node.
Shinu
Top achievements
Rank 2
 answered on 19 Jun 2014
1 answer
133 views
I have this Radgrid where I use a calculated column "column" to get the total value per row. I use a calculated column because the two items "Quantity" and "Cost" come from different db tables.

<MasterTableView CommandItemDisplay="Top" DataKeyNames="Id" DataSourceID="SqlDataSource1" PageSize="3000" GroupsDefaultExpanded="false">
                                <GroupByExpressions>
                                    <telerik:GridGroupByExpression>
                                        <GroupByFields>
                                            <telerik:GridGroupByField FieldName="Stgroup" />
                                        </GroupByFields>
                                        <SelectFields>
                                            <telerik:GridGroupByField  FieldName="Stgroup"/>
                                        </SelectFields>
                                    </telerik:GridGroupByExpression>
                                </GroupByExpressions>
                                <Columns>
                                    <telerik:GridEditCommandColumn ButtonType="ImageButton">
                                        <HeaderStyle Width="30px" />
                                    </telerik:GridEditCommandColumn>
                                    <telerik:GridBoundColumn DataField="Id" DataType="System.Int32" FilterControlAltText="Filter Id column" HeaderText="Id" SortExpression="Id" UniqueName="Id" ReadOnly="True">
                                        <ColumnValidationSettings>
                                            <ModelErrorMessage Text="" />
                                        </ColumnValidationSettings>
                                        <HeaderStyle Width="45px" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Code" DataType="System.Double" FilterControlAltText="Filter Code column" HeaderText="Code" SortExpression="Code" UniqueName="Code">
                                        <ColumnValidationSettings>
                                            <ModelErrorMessage Text="" />
                                        </ColumnValidationSettings>
                                        <HeaderStyle Width="65px" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Designation" FilterControlAltText="Filter Designation column" HeaderText="Designation" SortExpression="Designation" UniqueName="Designation">
                                        <ColumnValidationSettings>
                                            <ModelErrorMessage Text="" />
                                        </ColumnValidationSettings>
                                        <HeaderStyle Width="150px" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Description" FilterControlAltText="Filter Description column" HeaderText="Description" SortExpression="Description" UniqueName="Description" ReadOnly="True">
                                        <ColumnValidationSettings>
                                            <ModelErrorMessage Text="" />
                                        </ColumnValidationSettings>
                                        <HeaderStyle Width="150px" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Bkgroup" FilterControlAltText="Filter Bkgroup column" HeaderText="Bkgroup" SortExpression="Bkgroup" UniqueName="Bkgroup" DataType="System.Double">
                                        <ColumnValidationSettings>
                                            <ModelErrorMessage Text="" />
                                        </ColumnValidationSettings>
                                        <HeaderStyle Width="55px" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Stgroup" FilterControlAltText="Filter Stgroup column" HeaderText="Stgroup" SortExpression="Stgroup" UniqueName="Stgroup" DataType="System.Double">
                                        <ColumnValidationSettings>
                                            <ModelErrorMessage Text="" />
                                        </ColumnValidationSettings>
                                        <HeaderStyle Width="55px" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Type" FilterControlAltText="Filter Type column" HeaderText="Type" SortExpression="Type" UniqueName="Type">
                                        <ColumnValidationSettings>
                                            <ModelErrorMessage Text="" />
                                        </ColumnValidationSettings>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Standard" FilterControlAltText="Filter Standard column" HeaderText="Standard" SortExpression="Standard" UniqueName="Standard">
                                        <ColumnValidationSettings>
                                            <ModelErrorMessage Text="" />
                                        </ColumnValidationSettings>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Quantity" FilterControlAltText="Filter Quantity column" HeaderText="Quantity" SortExpression="Quantity" UniqueName="Quantity" DataType="System.Double">
                                        <ColumnValidationSettings>
                                            <ModelErrorMessage Text="" />
                                        </ColumnValidationSettings>
                                        <HeaderStyle Width="60px" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Unit" FilterControlAltText="Filter Unit column" HeaderText="Unit" SortExpression="Unit" UniqueName="Unit" ReadOnly="True">
                                        <ColumnValidationSettings>
                                            <ModelErrorMessage Text="" />
                                        </ColumnValidationSettings>
                                        <HeaderStyle Width="40px" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Cost" DataType="System.Double" FilterControlAltText="Filter Cost column" HeaderText="Cost BYR" SortExpression="Cost" UniqueName="Cost" DataFormatString="{0:N5}" ReadOnly="True">
                                        <ColumnValidationSettings>
                                            <ModelErrorMessage Text="" />
                                        </ColumnValidationSettings>
                                        <HeaderStyle HorizontalAlign="Center" Width="65px" />
                                    </telerik:GridBoundColumn>
                                    <telerik:GridCalculatedColumn DataFields="Quantity,Cost" DataFormatString="{0:N5}" Expression="{0}*{1}" FilterControlAltText="Filter column column" HeaderText="Tot. Cost BYR" UniqueName="column">
                                        <HeaderStyle HorizontalAlign="Center" />
                                    </telerik:GridCalculatedColumn>
                                    <telerik:GridBoundColumn DataField="Note" FilterControlAltText="Filter Note column" HeaderText="Note BOM" SortExpression="Note" UniqueName="Note">
                                        <ColumnValidationSettings>
                                            <ModelErrorMessage Text="" />
                                        </ColumnValidationSettings>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Note1" FilterControlAltText="Filter Note1 column" HeaderText="Note Comp." SortExpression="Note1" UniqueName="Note1" ReadOnly="True">
                                        <ColumnValidationSettings>
                                            <ModelErrorMessage Text="" />
                                        </ColumnValidationSettings>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridButtonColumn ButtonType="ImageButton" Text="Delete" CommandName="Delete" FilterControlAltText="Filter column1 column" ConfirmDialogType="RadWindow" ConfirmText="Do you really want to delete this project and all its content?" UniqueName="column1">
                                        <HeaderStyle Width="30px" />
                                    </telerik:GridButtonColumn>
                                </Columns>
 
                                <EditFormSettings>
                                    <FormStyle BackColor="Yellow" />
                                    <EditColumn UniqueName="EditCommandColumn1" FilterControlAltText="Filter EditCommandColumn1 column"></EditColumn>
                                </EditFormSettings>
 
                                <PagerStyle AlwaysVisible="True" Mode="NextPrevNumericAndAdvanced" PageButtonCount="50" />
                            </MasterTableView>
I am experiencing problem in getting the total value of each Group aggregated as sum in the group header. I have checked the documentation but still I am unable to get it. I would really appreciate if someone here can support me with an example based on the above grid. Thanks a lot,
Felice
Eyup
Telerik team
 answered on 19 Jun 2014
1 answer
91 views
I have a grid with a calculated column which is not bind to the db and I would like to calculate the group total based on such column sum (unique name: column).

<MasterTableView CommandItemDisplay="Top" DataKeyNames="Id" DataSourceID="SqlDataSource1">
                                <GroupByExpressions>
                                   <telerik:GridGroupByExpression>
                                       <GroupByFields>
                                           <telerik:GridGroupByField FieldName="Stgroup" />
                                       </GroupByFields>
                                       <SelectFields>
                                           <telerik:GridGroupByField FieldName="Stgroup" />
                                       </SelectFields>
                                   </telerik:GridGroupByExpression>
                               </GroupByExpressions>
                               <Columns>
                                    <telerik:GridEditCommandColumn ButtonType="ImageButton">
                                   <HeaderStyle Width="30px" />
                               </telerik:GridEditCommandColumn>
                                   <telerik:GridBoundColumn DataField="Id" DataType="System.Int32" FilterControlAltText="Filter Id column" HeaderText="Id" SortExpression="Id" UniqueName="Id" ReadOnly="True">
                                       <ColumnValidationSettings>
                                           <ModelErrorMessage Text="" />
                                       </ColumnValidationSettings>
                                       <HeaderStyle Width="45px" />
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn DataField="Code" DataType="System.Double" FilterControlAltText="Filter Code column" HeaderText="Code" SortExpression="Code" UniqueName="Code">
                                       <ColumnValidationSettings>
                                           <ModelErrorMessage Text="" />
                                       </ColumnValidationSettings>
                                       <HeaderStyle Width="65px" />
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn DataField="Designation" FilterControlAltText="Filter Designation column" HeaderText="Designation" SortExpression="Designation" UniqueName="Designation">
                                       <ColumnValidationSettings>
                                           <ModelErrorMessage Text="" />
                                       </ColumnValidationSettings>
                                       <HeaderStyle Width="150px" />
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn DataField="Description" FilterControlAltText="Filter Description column" HeaderText="Description" SortExpression="Description" UniqueName="Description" ReadOnly="True">
                                       <ColumnValidationSettings>
                                           <ModelErrorMessage Text="" />
                                       </ColumnValidationSettings>
                                       <HeaderStyle Width="150px" />
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn DataField="Bkgroup" FilterControlAltText="Filter Bkgroup column" HeaderText="Bkgroup" SortExpression="Bkgroup" UniqueName="Bkgroup" DataType="System.Double">
                                       <ColumnValidationSettings>
                                           <ModelErrorMessage Text="" />
                                       </ColumnValidationSettings>
                                       <HeaderStyle Width="55px" />
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn DataField="Stgroup" FilterControlAltText="Filter Stgroup column" HeaderText="Stgroup" SortExpression="Stgroup" UniqueName="Stgroup" DataType="System.Double">
                                       <ColumnValidationSettings>
                                           <ModelErrorMessage Text="" />
                                       </ColumnValidationSettings>
                                       <HeaderStyle Width="55px" />
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn DataField="Type" FilterControlAltText="Filter Type column" HeaderText="Type" SortExpression="Type" UniqueName="Type">
                                       <ColumnValidationSettings>
                                           <ModelErrorMessage Text="" />
                                       </ColumnValidationSettings>
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn DataField="Standard" FilterControlAltText="Filter Standard column" HeaderText="Standard" SortExpression="Standard" UniqueName="Standard">
                                       <ColumnValidationSettings>
                                           <ModelErrorMessage Text="" />
                                       </ColumnValidationSettings>
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn DataField="Quantity" FilterControlAltText="Filter Quantity column" HeaderText="Quantity" SortExpression="Quantity" UniqueName="Quantity" DataType="System.Double">
                                       <ColumnValidationSettings>
                                           <ModelErrorMessage Text="" />
                                       </ColumnValidationSettings>
                                       <HeaderStyle Width="60px" />
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn DataField="Unit" FilterControlAltText="Filter Unit column" HeaderText="Unit" SortExpression="Unit" UniqueName="Unit" ReadOnly="True">
                                       <ColumnValidationSettings>
                                           <ModelErrorMessage Text="" />
                                       </ColumnValidationSettings>
                                       <HeaderStyle Width="40px" />
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn DataField="Cost" DataType="System.Double" FilterControlAltText="Filter Cost column" HeaderText="Cost BYR" SortExpression="Cost" UniqueName="Cost" DataFormatString="{0:N5}" ReadOnly="True">
                                       <ColumnValidationSettings>
                                           <ModelErrorMessage Text="" />
                                       </ColumnValidationSettings>
                                       <HeaderStyle HorizontalAlign="Center" Width="65px" />
                                   </telerik:GridBoundColumn>
                                    <telerik:GridCalculatedColumn DataFields="Quantity,Cost" DataFormatString="{0:N5}" Expression="{0}*{1}" FilterControlAltText="Filter column column" HeaderText="Tot. Cost BYR" UniqueName="column">
                                        <HeaderStyle HorizontalAlign="Center" />
                                    </telerik:GridCalculatedColumn>
                                   <telerik:GridBoundColumn DataField="Note" FilterControlAltText="Filter Note column" HeaderText="Note BOM" SortExpression="Note" UniqueName="Note">
                                       <ColumnValidationSettings>
                                           <ModelErrorMessage Text="" />
                                       </ColumnValidationSettings>
                                   </telerik:GridBoundColumn>
                                   <telerik:GridBoundColumn DataField="Note1" FilterControlAltText="Filter Note1 column" HeaderText="Note Comp." SortExpression="Note1" UniqueName="Note1" ReadOnly="True">
                                       <ColumnValidationSettings>
                                           <ModelErrorMessage Text="" />
                                       </ColumnValidationSettings>
                                   </telerik:GridBoundColumn>
                                    <telerik:GridButtonColumn ButtonType="ImageButton" Text="Delete" CommandName="Delete" FilterControlAltText="Filter column1 column" ConfirmDialogType="RadWindow" ConfirmText="Do you really want to delete this project and all its content?" UniqueName="column1">
                                   <HeaderStyle Width="30px" />
                               </telerik:GridButtonColumn>
                               </Columns>

All example I have found are summing bind columns, how can I achieve to get the total of groups on a not bind calculated column?
Eyup
Telerik team
 answered on 19 Jun 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?