This is a migrated thread and some comments may be shown as answers.

GridCalculatedColumn and footer total calculation

3 Answers 191 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Venkatesh
Top achievements
Rank 1
Venkatesh asked on 16 Jan 2013, 07:39 AM

Hi,

I have 2 numeric textbox, gridcalculated column and footer column.
Once the value is entered in the numeric textbox (something like onblur), i want to calculate the value for gridcalculated column and footer column. The lblTotalValue should have the total of the "GridCalculatedColumn".
This is the UI which I have:

<telerik:GridTemplateColumn UniqueName="OrderQuantity" HeaderText="Order Quantity" DataField="OrderQuantity">
            <EditItemTemplate>           
                <telerik:RadNumericTextBox ID="txtOrderQuantity" runat="server" >
                </telerik:RadNumericTextBox>                
            </EditItemTemplate>        
        </telerik:GridTemplateColumn>
  
        <telerik:GridTemplateColumn UniqueName="UnitPrice" HeaderText="Unit Price" DataField="UnitPrice">
            <EditItemTemplate>
                <telerik:RadNumericTextBox ID="txtUnitPrice" runat="server" >
                </telerik:RadNumericTextBox>              
            </EditItemTemplate>
            <FooterTemplate>
            <asp:Label ID="lblTotal" Text="Total: " runat="server"></asp:Label>
            <asp:Label ID="lblTotalValue" runat="server"></asp:Label>
            </FooterTemplate>  
        </telerik:GridTemplateColumn>
  
            <telerik:GridCalculatedColumn DataFormatString="{0:C}" DataType="System.Double" HeaderText="Extended Price"
                UniqueName="ExtendedPrice" DataFields="OrderQuantity,UnitPrice" Expression="{0}*{1}"
                Aggregate="Sum" Visible="true">                
            </telerik:GridCalculatedColumn>

How to achieve this?
Thanks

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 21 Jan 2013, 01:11 PM
Hello,

I suggest you go through the forum thread below which elaborates on similar subject:
http://www.telerik.com/community/forums/aspnet/grid/radgrid-calculatedcolumn-based-on-templatecolumn.aspx

Greetings,
Pavlina
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Koen
Top achievements
Rank 1
answered on 21 Mar 2016, 01:40 PM
That page no longer exists. Is there a similar solution somewhere?
0
Pavlina
Telerik team
answered on 24 Mar 2016, 12:08 PM
Tags
Grid
Asked by
Venkatesh
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Koen
Top achievements
Rank 1
Share this question
or