473,811 Members | 2,324 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How DataGrid Sum Total?

Sam
I successfully created DataGrid with connected environment but how do I
perform sum of TotalRBAmount in DataGrid?
Coding of ASP.Net 1.1
------------------------

<form runat="server">
<wmx:SqlDataSou rceControl id="SqlDataSour ceControl1" runat="server"
UpdateCommand=" " SelectCommand=" SELECT * FROM [History_RetireB enefit] order
by costcenterno asc,employeenam e asc,yearnum desc"
AutoGenerateUpd ateCommand="Fal se"
ConnectionStrin g="server='sqls vr';Database='R etire_Benefit'"
DeleteCommand=" "></wmx:SqlDataSour ceControl>
<wmx:MxDataGr id id="MxDataGrid1 " runat="server" PageSize="1000"
DataSourceContr olID="SqlDataSo urceControl1" BorderColor="#C CCCCC"
AllowSorting="T rue" AutoGenerateFie lds="False"
DataMember="His tory_RetireBene fit" AllowPaging="Tr ue" BackColor="Whit e"
CellPadding="3" BorderWidth="1p x" BorderStyle="No ne" Font-Size="X-Small">
<SelectedItemSt yle font-bold="True" forecolor="Whit e"
backcolor="#669 999"></SelectedItemSty le>
<ItemStyle forecolor="Blac k"></ItemStyle>
<FooterStyle forecolor="#000 066" backcolor="Whit e"></FooterStyle>
<HeaderStyle font-bold="True" forecolor="Whit e"
backcolor="#006 699"></HeaderStyle>
<PagerStyle horizontalalign ="Center" forecolor="#000 066"
backcolor="Whit e" mode="NumericPa ges"></PagerStyle>
<Fields>
<wmx:BoundFie ld DataField="empn o" SortExpression= "empno"
HeaderText="Emp loyeeNo"></wmx:BoundField>
<wmx:BoundFie ld DataField="empn ame" SortExpression= "empname"
HeaderText="Nam e"></wmx:BoundField>
<wmx:BoundFie ld DataField="dept " SortExpression= "dept"
HeaderText="Dep t"></wmx:BoundField>
<wmx:BoundFie ld DataField="Year Num" SortExpression= "YearNum"
HeaderText="Yea r"></wmx:BoundField>
<wmx:BoundFie ld DataField="RBBF " SortExpression= "RBBF"
HeaderText="RBB F"></wmx:BoundField>
<wmx:BoundFie ld DataField="Basi cEarnMTD"
SortExpression= "BasicEarnM TD" HeaderText="Bas icEarnMTD"></wmx:BoundField>
<wmx:BoundFie ld DataField="RBAm ount" SortExpression= "RBAmount"
HeaderText="RBA mount"></wmx:BoundField>
<wmx:BoundFie ld DataField="Inte restAmount"
SortExpression= "InterestAmount "
HeaderText="Int erestAmount"></wmx:BoundField>
<wmx:BoundFie ld DataField="Tota lRBAmount"
SortExpression= "TotalRBAmo unt" HeaderText="Tot alRBAmount"></wmx:BoundField>
<wmx:BoundFie ld DataField="RBty pe" SortExpression= "RBtype"
HeaderText="RBt ype"></wmx:BoundField>
<wmx:BoundFie ld DataField="Cate gory" SortExpression= "Category"
HeaderText="Cat egory"></wmx:BoundField>
</Fields>
</wmx:MxDataGrid>
</form>

Question ?
----------

- How to calculate sum of TotalRBAmount in DataGrid?

Please advise.

Thanks.

Nov 19 '05 #1
1 1883
There is an example here:
http://aspnet.4guysfromrolla.com/articles/020503-1.aspx

HTH,
--
Scott
http://www.OdeToCode.com/blogs/scott/
I successfully created DataGrid with connected environment but how do
I perform sum of TotalRBAmount in DataGrid?

Coding of ASP.Net 1.1
------------------------
<form runat="server">
<wmx:SqlDataSou rceControl id="SqlDataSour ceControl1" runat="server"
UpdateCommand=" " SelectCommand=" SELECT * FROM [History_RetireB enefit]
order
by costcenterno asc,employeenam e asc,yearnum desc"
AutoGenerateUpd ateCommand="Fal se"
ConnectionStrin g="server='sqls vr';Database='R etire_Benefit'"
DeleteCommand=" "></wmx:SqlDataSour ceControl>
<wmx:MxDataGr id id="MxDataGrid1 " runat="server" PageSize="1000"
DataSourceContr olID="SqlDataSo urceControl1" BorderColor="#C CCCCC"
AllowSorting="T rue" AutoGenerateFie lds="False"
DataMember="His tory_RetireBene fit" AllowPaging="Tr ue"
BackColor="Whit e"
CellPadding="3" BorderWidth="1p x" BorderStyle="No ne"
Font-Size="X-Small">
<SelectedItemSt yle font-bold="True" forecolor="Whit e"
backcolor="#669 999"></SelectedItemSty le>
<ItemStyle forecolor="Blac k"></ItemStyle>
<FooterStyle forecolor="#000 066" backcolor="Whit e"></FooterStyle>
<HeaderStyle font-bold="True" forecolor="Whit e"
backcolor="#006 699"></HeaderStyle>
<PagerStyle horizontalalign ="Center" forecolor="#000 066"
backcolor="Whit e" mode="NumericPa ges"></PagerStyle>
<Fields>
<wmx:BoundFie ld DataField="empn o" SortExpression= "empno"
HeaderText="Emp loyeeNo"></wmx:BoundField>
<wmx:BoundFie ld DataField="empn ame" SortExpression= "empname"
HeaderText="Nam e"></wmx:BoundField>
<wmx:BoundFie ld DataField="dept " SortExpression= "dept"
HeaderText="Dep t"></wmx:BoundField>
<wmx:BoundFie ld DataField="Year Num" SortExpression= "YearNum"
HeaderText="Yea r"></wmx:BoundField>
<wmx:BoundFie ld DataField="RBBF " SortExpression= "RBBF"
HeaderText="RBB F"></wmx:BoundField>
<wmx:BoundFie ld DataField="Basi cEarnMTD"
SortExpression= "BasicEarnM TD"
HeaderText="Bas icEarnMTD"></wmx:BoundField>
<wmx:BoundFie ld DataField="RBAm ount" SortExpression= "RBAmount"
HeaderText="RBA mount"></wmx:BoundField>
<wmx:BoundFie ld DataField="Inte restAmount"
SortExpression= "InterestAmount "
HeaderText="Int erestAmount"></wmx:BoundField>
<wmx:BoundFie ld DataField="Tota lRBAmount"
SortExpression= "TotalRBAmo unt"
HeaderText="Tot alRBAmount"></wmx:BoundField>
<wmx:BoundFie ld DataField="RBty pe" SortExpression= "RBtype"
HeaderText="RBt ype"></wmx:BoundField>
<wmx:BoundFie ld DataField="Cate gory" SortExpression= "Category"
HeaderText="Cat egory"></wmx:BoundField>
</Fields>
</wmx:MxDataGrid>
</form>

Question ?
----------
- How to calculate sum of TotalRBAmount in DataGrid?

Please advise.

Thanks.

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1734
by: Pietje de kort | last post by:
Hello, why is the System.Windows.Forms.DataGrid so un-customizable? I am trying to build a DataGrid that will resize it's last column when there is room left over (make it fill the total clientwidth). I am almost capable of doing so by the following actions: - Create a custom DataGridTableStyle called AutoResizeDataGridTableStyle - Hook up the OnResize and OnDataSourceChanged from the AutoResizeDataGridTableStyle to their respected...
2
5342
by: Jon | last post by:
I have a datagrid with a total row on the bottom. What is the best method to "instantly" update the total row when the value of any row changes. I am running into problems when I use the column changed event to calculate the total and assign it directly to the grid -> myDataGridObject=newTotal. When I do this, more change events are fired, causing unwanted consequences.
0
1359
by: Karl | last post by:
Hi all, I have naive question about datagrid. When the total record number in datagrid is less than the datagrid row number, datagrid doesn't show the vertical scrollbar. Otherwise, it shows scrollbar. If I don't save some space for vertical scrollbar, datagrid displays all the columns nicely when total record number in datagrid is less than the datagrid row number. But scrollbar will cover part of last of the column when total record...
0
2139
by: buran | last post by:
Dear ASP.NET Users, How can I get the total number of rows selected by the command text of the datagrid (items in datagrid)? If I use the statement grdSP.Items.Count with the datagrid grdSP with paging, it returns the page size (5,10..) not the total results. How can I get the total no? Thanks in advance, Buran
2
1444
by: brian richards | last post by:
The datagrid in my page always looks greyed out. But DataGrid.Enabled is set to true. It's never set to false. Is there any other way enabled may be set to false? Or maybe another reason other than the Enabled property that would cause this? I've included the asp.net code and the C# databind code. Thanks
8
1196
by: André Almeida Maldonado | last post by:
Hey Guys... What is the diference in bind data into a datagrid without predefined columns and a datagrid with predifined columns???? When I try to bind data into a datagrid without predefined columns, I have sucess. Otherwise, I don't have sucess. Why????
2
1511
by: Jon | last post by:
Hi, Working on a shopping cart app. I'm using a datagrid on the shopping cart page with boundcolumns to display Product name, cost, quantity etc - that all works fine. However I want to add a row to the bottom of the grid to display cart total, so I'd end up with something like this Product Cost Quantity Sub Total Product1 10.22 1 10.22 Product2 5.00 2 10.00 Cart Total ...
1
2801
by: MSNEWS | last post by:
Hi I have a datagrid with 8 Columns, columns called Monday - Sunday, and a column called TOTAL. The Monday - Sunday columns are template columns with a textbox inside. The TOTAL column is a label column. When the user enteres numbers into the Monday - Sunday columns I want TOTAL to add up all the columns on the current row. I guess this needs to be done with client side vbscript? But I have no clue
2
2838
by: Coleen | last post by:
Hi All :-) I have a Fro?next loop where I have to calculate a grand total. I need to use that grand total to calculate percentages of data from the same For/Next loop. I can't get the grand total until the loop completes, so I have created another datagrid to dump the value of the grand total into. Now, I need to get the total from that datagrid and use it in my original For/Next Loop. Any suggestions on how to do this? I have tried:...
2
11129
by: patang | last post by:
I found the following to count the total number of VISIBLE rows of datagrid datagrid.visiblerowcount How do we count the total number of ACTUAL (not just visible) rows of datagrid? Thanks in advance.
0
10389
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10402
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10135
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9205
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7670
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6890
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5554
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5692
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3018
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.