473,738 Members | 6,332 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help me .....Specified argument was out of the range of valid values.

9 New Member
Hi ,
Am trying to sum the total in the footer if a gridview,
but am getting the error "Specified argument was out of the range of valid values.
Parameter name: index "..Its Printing one cell value in the footer..
But for the seond sum,it showing the error, the value is getting,

Help me pls..
Here is the ode snippent


Expand|Select|Wrap|Line Numbers
  1. Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound
  2.         Dim sumPurchase As Double
  3.         sumPurchase = 0
  4.         sumPurchase = Ds.Tables(0).Compute("SUM(Purchase)", String.Empty).ToString
  5.         'If e.Row.RowType = DataControlRowType.DataRow Then
  6.         '    sumPurchase += Convert.ToDouble(DataBinder.Eval(e.Row.DataItem, "Purchase"))
  7.         'Else
  8.         If e.Row.RowType = DataControlRowType.Footer Then
  9.             e.Row.Cells(0).Text = "Total"
  10.             e.Row.Cells(2).Text = FormatCurrency(sumPurchase, 0)
  11.  
  12.             'e.Row.Cells(2).Text = sumPurchase
  13.             'e.Row.Cells(3).HorizontalAlign = HorizontalAlign.Right
  14.             'e.Row.Font.Bold = True
  15.         End If
  16. End Sub
Feb 28 '07 #1
1 2617
kenobewan
4,871 Recognized Expert Specialist
Here is an article that may help:
Displaying Summary Information in the GridView's Footer
Feb 28 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
5478
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- Hello, I have a very simple problem but cannot seem to figure it out. I have a very simple php script that sends a test email to myself. When I debug it in PHP designer, it works with no problems, I get the test email. If
3
3478
by: Michael Conroy | last post by:
Hi... Synposis... Throws exception: "Specified argument was out of the range of valid values." Read on for the juicy tidbits. MySimpleClassCol mscc=new MySimpleClassCol(); private void InitCombo() {
3
1356
by: Catalin Porancea | last post by:
Can anybody tell me what is wrong with this code? I would really appreciate some help here. The data grid has 4 columns (0,1,2,3), and 1 is not visible. Whenever I click Edit, I get this error: _____________________________ Specified argument was out of the range of valid values. Parameter name: index Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more...
3
2872
by: John Crowley | last post by:
I've run into a problem where drop down lists are refusing to data bind with the following error on the DataBind() call Specified argument was out of the range of valid values. Parameter name: value Stack trace is showing the error in OnDataBinding event, which I don't hook in the cases where I'm getting this error ArgumentOutOfRangeException: Specified argument was out of the range of valid values Parameter name: value...
9
5811
by: subdhar | last post by:
I'm getting following error in asp.net application.I search the web and couldn't find error like this can any one help me in trouble with this error Specified argument was out of the range of valid values. Parameter name: U Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
4
1778
by: jensen bredal | last post by:
Hello, i was not able to find any documentation about the largest value one can assign the "timeout" attribute of the <sessionState section in web.config. any idea?
1
3716
by: Rahul | last post by:
Hi Everybody I have some problem in my script. please help me. This is script file. I have one *.inq file. I want run this script in XML files. But this script errors shows . If u want i am attach this script files and inq files. I cant understand this error. Please suggest me. You can talk with my yahoo id b_sahoo1@yahoo.com. Now i am online. Plz....Plz..Plz...
0
1251
by: evantri | last post by:
// File name: command.c #include <stdio.h> #include <string.h> #include <stdlib.h> int main (int argc, char *argv) { int i; double minx = -1.0;
1
2026
by: RN1 | last post by:
I have a DataGrid with 7 BoundColumns. A user can login as an admin or non-admin. When a user logs in as a non-admin & the DatGrid is in the editable mode, I want only the first 4 columns i.e. the TextBoxes in the first 4 columns to be editable & the remaining 3 TextBoxes should remain disabled. This is what I tried (in the OnItemDataBound event functions): -------------------- If (sessAdmin = 0) Then For i = 4 To 6
0
9473
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9334
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...
0
8208
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
6750
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
6053
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
4569
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
4824
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2744
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
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.