473,408 Members | 2,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

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

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 2601
kenobewan
4,871 Expert 4TB
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
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 -------------------------------------------------------------------------------- ...
3
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...
3
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:...
3
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:...
9
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...
4
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
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...
0
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
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...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
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...
0
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...

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.