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

Radgrid Row Summary Error

4 Answers 75 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Purojit
Top achievements
Rank 1
Purojit asked on 27 Jun 2013, 12:16 PM
Hi,

 I am  showing bill register in RADGRID. However if a customer has bought more than one item, then I am adding Bill Total in the "B.AMT"  column. But the problem is ,while doing column summary, the bill total is counted as per number of items in case there are more than one item bought by customer. Please find in the attached screenshot.
Here Gopal TODI has bought 2 items  of total amt. 66778. But while calculating the summary of B.AMT ,66778 is added twice.

Please look into this.

Regards
Purojit

4 Answers, 1 is accepted

Sort by
0
Alex
Top achievements
Rank 2
answered on 27 Jun 2013, 02:49 PM
Why don't you use "Aggregate" property from GridBoundColumn.
0
Princy
Top achievements
Rank 2
answered on 28 Jun 2013, 05:57 AM
Hi Purojit,

Please check the following demos,i am not sure how you are adding the values .If these links didn't help,please provide your code.
Grid - Footer Aggregates
Grid - Calculated Columns

Thanks,
Princy
0
Purojit
Top achievements
Rank 1
answered on 29 Jun 2013, 01:24 PM
Hi Princy,

Thanks for your reply. But these links are not helpful. Please read our post carefully and check the snap, I hope you will understand.

Thanks
Purojit
0
Princy
Top achievements
Rank 2
answered on 08 Jul 2013, 10:14 AM
HI Purojit,

Please try the following code snippet.I have attached the screenshot of what i obtained.Please let me know if any concern.

ASPX:
<telerik:RadGrid ID="Radgrid1" runat="server" DataSourceID="SqlDataSource1" ShowFooter="true">
    <MasterTableView AutoGenerateColumns="false" DataSourceID="SqlDataSource1">
        <Columns>
            <telerik:GridBoundColumn DataField="OrderID" HeaderText="OrderID" UniqueName="OrderID">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Quantity" HeaderText="Quantity" UniqueName="Quantity">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="UnitPrice" HeaderText="UnitPrice" UniqueName="UnitPrice">
            </telerik:GridBoundColumn>
            <telerik:GridCalculatedColumn HeaderText="Total" UniqueName="TotalPrice" DataType="System.Double"
                DataFields="Quantity, UnitPrice" Expression="{0}*{1}" FooterText="Total : " Aggregate="Sum">
            </telerik:GridCalculatedColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>

Thanks,
Princy
Tags
Grid
Asked by
Purojit
Top achievements
Rank 1
Answers by
Alex
Top achievements
Rank 2
Princy
Top achievements
Rank 2
Purojit
Top achievements
Rank 1
Share this question
or