Forms Data Controls :: How To Add Subtotal Row In Gridview

Feb 22, 2008

I have a gridview that I programmatically bind to a dataset.

I use compute to get the totals and then display it in the gridview eg GridView1.Columns(4).FooterText = "$ " & FormatNumber(MoneybagTot, 0)

My Question is: How do I add a subtotal row after each group and how do I get the totals in each group


Now I want row inserted after end of Africa, that says Total and I want to get the sum in Salary column


Forms Data Controls :: How To Display Subtotal /vat / Total In Gridview Footer

Nov 10, 2009

I have to display subtotal, vat,total in gridview footer. I am doing like this but nothing is displayed.

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
CellPadding="4" Font-Names="Verdana" Font-Size="Small" ForeColor="#333333"
PageSize="900" Width="600px" EmptyDataText="No items in your cart!!"
DataKeyNames="REF" GridLines="None" ShowFooter="True"
<FooterStyle BackColor="#1C5E55" ForeColor="#FFFFFF" Font-Bold="True" />
<RowStyle BackColor="#E3EAEB" />
<asp:BoundField DataField="REF" HeaderText="REF" SortExpression="REF"
ItemStyle-Width="60px" >
<ItemStyle Width="60px"></ItemStyle>
<asp:TemplateField HeaderText="product_id" Visible="False">
<asp:Label ID="lblProduct_Id" runat="server" Text='<%# Eval("REF") %>'></asp:Label>
<asp:BoundField DataField="Description" HeaderText="Description"
SortExpression="Description" ItemStyle-Width="300px" >
<ItemStyle Width="300px"></ItemStyle>
<asp:TemplateField HeaderText="Description" Visible="False">
<asp:Label ID="lblDescription" runat="server" Text='<%# Eval("Description")%>' ></asp:Label>
<asp:TemplateField HeaderText="QTY">
<asp:TextBox ID="TxtQTY" runat="server" Width="30px" Text='<%# Eval("QTY") %>' />
<asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price"
ItemStyle-Width="80px" >
<ItemStyle Width="80px"></ItemStyle>
<asp:TemplateField HeaderText="Price" Visible="False">
<asp:Label ID="lblPrice" runat="server" Text='<%# Eval("Price")%>' ></asp:Label>
<asp:BoundField DataField="Cost" HeaderText="Cost" SortExpression="Cost"
ItemStyle-Width="80px" >
<ItemStyle Width="80px"></ItemStyle>
<asp:TemplateField HeaderText="Cost" Visible="False">
<asp:Label ID="lblCost" runat="server" Text='<%# Eval("Cost")%>' ></asp:Label>
<asp:Label ID="lblSubTotal" runat="server" ForeColor="#ffffff" />
<asp:TemplateField HeaderText="Select">
<asp:CheckBox ID="chkSelection" runat="server" />
<PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#C5BBAF" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#1C5E55" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#7C6F57" />
<AlternatingRowStyle BackColor="White" />
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
if (e.Row.RowType == DataControlRowType.DataRow)
Label lblCost = (Label)e.Row.FindControl("lblCost");
float price = float.Parse(lblCost.Text);
tprice += price;
if (e.Row.RowType == DataControlRowType.Footer)
Label lblSubTotal = (Label)e.Row.FindControl("lblSubTotal");
lblSubTotal.Text = tprice.ToString();

assist where I am doing wrong...

View 5 Replies View Related

Forms Data Controls :: Gridviewhelper Cannot Subtotal 2 Column

Sep 15, 2010

gridviewhelper cannot subtotal 2 column


A 1 2

A 3 3

4 5

View 1 Replies View Related

Forms Data Controls :: Adding Subtotal To A Group Of Records (not In Footer)?

Jun 1, 2010

I have trawled through the entire web and found that most examples show how to add a total to the footer.

However, I am not after this and I want to add a total for the column 'Office sqm' for each group of addresses ONLY when the value of the 'Summed' is equal to Yes.


View 8 Replies View Related

Gridview Subtotal Using Jquery In C#?

Jan 1, 2011

i am having a problem in counting subtotal in a gridview in

the gridview contains details like


i need to calculate the sum of the user entry for each item and display into the resultant lable.

when ever the user entry is made the value in the result lable should be updated,i am binding a javascript function to the userentry textbox in rowdatabound event in code the javascript i am able to roll over all the rows of table using jquery, and calculate the value. here is the catch, the labletodispresult should be for that item group only, i.e. i need to get the sum of userentry for A -1,A-2, A-3 rows and seperately for B-1,B-2,B-3 rows, the i am using a class for the userentry textbox, and using this


this gives me all the textboxes sum value, but i need the values based on the Item group.

View 1 Replies View Related

C# - Calculate SubTotal In Devexpress Gridview?

Mar 20, 2011

I have a simple Devexpress Gridview.

Here code;


Is there any way calculate sub total of Unit Price column in Devexpress?

For this example; I just want total of Unit Price column (18 + 19 + 4.5 + 14 + 18 + 263.5 + 18 + 46 + 14 + 14 + 15 = 430) in the bottom..

How can i do that?

View 2 Replies View Related

Forms Data Controls :: Trying To Add Subtotal In Gridfooter With Has Grid Inside Grid?

Jun 1, 2010

i am trying to add subtotal in gridfooter with has grid inside grid

View 1 Replies View Related

Web Forms :: Sum Up 2 Field As A New Column - SubTotal In Microsoft Visual Studio 2010 Sql Express 2008

Aug 14, 2010

How to do sum 2 differences fields as a new column in Subtotal ? I know to do in Microsoft Access and that is easier.

View 2 Replies View Related

SQL Reporting :: Can Subtotal In Matrix Be In A Different Group

Apr 13, 2010

I'm using reporting services in visual studio 2005.

I'm using a matrix and it looks like this.


View 8 Replies View Related

SQL Reporting :: What Is The Difference Between Matrix And Subtotal

Sep 29, 2009

I have a matrix and i want in the subtotal column, instead of sum, i want to get the difference. Is there anyway to do this ?

View 7 Replies View Related

Calculating Total By Adding Subtotal Column?

Jan 28, 2009

I have a Datatable binding into a session and a GridView to display the rows in the datatable. now I am having some difficults with calculating the Total by adding all subtotal column cells and dispaying the total on label.

this is the fuction I am trying to work with.


View 1 Replies View Related

Forms Data Controls :: (Grid View Union Gridview) - (Gridview Intersection Gridview) - Avoiding The Duplicates

Jul 19, 2010

I have two gridviews, say 'A' and 'B'...I want to add all the rows of 'A' to 'B' while avoiding the duplicates....For eg:

View 10 Replies View Related

Forms Data Controls :: Show Child Gridview In Parent Gridview Using Nested Gridview

Dec 1, 2010

In nested gridview, i am finding some problem, i want to show child Grid headers in Parent Gridview. Can anyone tell me that how it is possible? Its very urgent. Waiting for quick response.

View 1 Replies View Related

Forms Data Controls :: Gridview SelectedIndex / Unable To Access The Data In The Gridview's Selected Row

Jul 31, 2010

I am unable to access the data in the gridview's selected row. I have done this lots of times but must be forgetting something.

Here is my gridview:


View 4 Replies View Related

Forms Data Controls :: Access Controls Inside Gridview When An Event Outside Gridview Fires?

Jan 10, 2010

I have a dropdownlist outside the gridview control. My griview control also have dropdownlist in the first column. I want to populate the dropdownlist inside the gridview control for all rows when the selected item is changed in the outside dropdownlist.

View 2 Replies View Related

Forms Data Controls :: How To Show GridView Footer Visible, If No Data In GridView

Jan 17, 2010

I have a customized gridvew i.e. grvResult. There is a textbox and a InsertButton in the footer.

If there is a data populated into gridview it is showing GridView footer and inserting data but if there is no data in gridview then its footer also not visible.

I have tried in two ways to make footer visible but it is showing following error:

Object reference not set to an instance of an object.

Tried ways:



View 2 Replies View Related

Forms Data Controls :: Gridview To Excel (adding Data Outside Of The Gridview)

Jan 28, 2011

I was wondering if it is possible to add additional data to Excel document created from gridview. What I want to do is to manually add data to certain rows and columns (date, couple of titles, etc), but I'm not sure how to do it.

Currently I'm using the following code:


View 5 Replies View Related

Forms Data Controls :: GridView Pass And Update Data To Another GridView?

Nov 19, 2009

I filtering Data to GridView 1 using LingDataSource 1 Tables Main - Name After click select I whoud like to pass and update data to GridView 2 LingDataSource 2 Tables Users - UName
I thought get Data from GridView1

Dim raw As GridViewRow=GridView1.SelectedRo

View 2 Replies View Related

Forms Data Controls :: Transfering Data From One Gridview To Another Page Gridview?

Apr 14, 2010

iam using with c#, my grid contains 1st column is check box ,and paging is true ,iam displaying data from view that does not contain primary key, so based on this when user selects the no of checkboxes in 1st page and in another page some records then i want to transfer to another page gridview but it is not displaying. can you correct my code where iam going wrong

string constr = "Data Source=MAINSERVER;Initial Catalog=Inventory;User ID=sa;Password=nsg";
protected void Page_Load(object sender, EventArgs e)


View 3 Replies View Related

Forms Data Controls :: To Add Insert Button To A GridView And A Scroll Bar To A Given Gridview Column?

Jul 9, 2010

how to implement Insert feature to a grid view?I need to use fields with scroll bar inside of a grid view. Is that possible through the template field?

View 23 Replies View Related

Forms Data Controls :: Populate Dropdownlist In A Gridview By Selecting Another Dropdown In Same Gridview

Oct 9, 2010

How to populate dropdownlist in a gridview by selecting another dropdown in same gridview

i tried the code in driiopdownlist selectedchanged

dropdownlist d=(dropdownlist)gridview.findcontrol("dropdownlist1") but it gives null

View 4 Replies View Related

Forms Data Controls :: Decrement Gridview RowCount When Deleting Record From Inner GridView?

Apr 22, 2010

Using 2005.I have an inner gridview.The outer gridview is "Authors" and in the inner gridview (GridView1 below) I have to set it up so that the user cannot delete the last book from the inner grid, if they try to delete the last book from that inner grid then I want to show the exception message below.

So I am checking the GridViewRows1.Rows.Count which works great when I have one record (one book) to start with. The problem is when I have 2 books (for example). I am writing out the test statement below and the RowCount is always 2 each time, never decremented, even after I rebind.Editing this now: i realize that my initial logic is faulty because when I rebind my inner gridview I am not specifying which inner gridview so the result is that only the last inner gridview is being re-bound, so I think that I need to get the selected inner gridview and then refresh that...


View 1 Replies View Related

Forms Data Controls :: Google Maps And GridView With Href (embedded In GridView)?

Mar 9, 2010

I had a problem with my site in the past couple days and have almost recovered, but now I'm stuck on some code that has an Auto-Complete feature, which allows a user to type a name of a pub into a TetxBox, and based on the returned names, the user can click one and see that name in the GridView (just below the TextBox). The GridView was set up so that there was an href that the user could click on and that would open a window and the user would see the pub in Google Maps. The code below works just fine for the Auto-Complete and the GridView.


Here is the end of the working code. Somehow I need to use the code below to make
the GridView have a href to allow a user to click and see the pub in Google


The code above worked fine before, but I'm not sure how it was incorporated into the GridView, and since I had a problem with my site a few days ago, I haven't been able to figure out this part.I'd sincerely appreciate any help in getting this up and running again.

View 4 Replies View Related

Forms Data Controls :: Gridview Selections To Populate Another Gridview Or Control With Selection From First

Feb 19, 2010

I currently have a gridview that has 1 column with radiobuttons. I then have a update button to update all the selected records. But what i want to do is add a step before the update. I want to add a multi-line textbox for each radiobutton selected to allow them to add notes/comments for each record before the update occurs.

Because the textbox will be large to allow them to enter the comments, i wanted to list them out seperately per record selected. Maybe a gridview is not what i need for the 2nd part, but thats the scenario and looking for suggestions on what / how to do it.



ID column1 column2 column3 radiocolumn
1 1111 2222 3333 Yes / No (selected Yes)
2 2222 3333 4444 Yes / No


ID NotesColumn
1 Texbox displays here

View 20 Replies View Related

Forms Data Controls :: Display A One Row Gridview When Gridview Is Bound To Empty Dataset

Jan 13, 2010

If the gridview binds to empty dataset, I need to still show a gridview so that users can ADD more using the textfields in the bottom of the footer template. Since the gridview is empty it won't bind not allowing rendering of the <footer template> I guess I should create a empty dataset if the gridview is empty. How do I check for this and can this be done in GridviewRowEventArgs

View 5 Replies View Related

Forms Data Controls :: Gridview Header And Footer Should Not Move While Scrolling Gridview

Sep 13, 2010

i am using Grid view. when ever bulk data is there in Gridview, Header and footer must not be move..

how can i do that.

View 3 Replies View Related

Forms Data Controls :: How To Update Parent Gridview After Updating Child Gridview

Dec 14, 2010

I have a parent gridview which has a child gridview in the itemsTemplate. Both are binded to different SqlDataSources. I can successfully update and delete rows in the child gridview. After updating in the child gridview, some related data in the parent gridview are not updated automatically. So i have placed ParentGridview.Databind() in the rowupdated event of child gridview. But it doesnt look working.

How can i accomplish this?

View 4 Replies View Related

Forms Data Controls :: Gridview FindControl / Access Textbox In Second Gridview Footertemplate

Mar 17, 2011

I have nested 2gridview. I want to access textbox in second gridview footertemplate. How can I do this.My code is


Code Behind


Iwrite this code but I get

Object reference not set to an instance of an object.

View 11 Replies View Related

Forms Data Controls :: Gridview Check Missing 1st One With Gridview Helper Classes

Feb 23, 2010

im reading checkbox value which is checked on my gridview but as per my code is missing the 1st one which on top but i select from the middle then it is working fine here is link for gridviewhelper classes [URL] and im calling this code from gridviewhelper classes on page load event

Dim helper As New GridViewHelper(Me.GridView2)
helper.RegisterGroup("heading", True, True)
AddHandler helper.GroupHeader, AddressOf helper_GroupHeader

and here is my code

Dim sc As New StringCollection()
Dim id As String = String.Empty
For i As Integer = 0 To GridView2.Rows.Count - 1
'loop the GridView Rows
Dim cb As CheckBox = DirectCast(GridView2.Rows(i).Cells(2).FindControl("CheckBox2"), CheckBox)
'find the CheckBox
If cb IsNot Nothing Then
If cb.Checked Then
id = GridView2.Rows(i).Cells(1).Text
End If
End If

View 1 Replies View Related

Forms Data Controls :: Gridview Sorting Failed If Multiple Gridview Are Created

Mar 10, 2011

I got a web page, it has a tabcontainer, within each tab, there will be a gridview, all the tabs and gridview are created at run-time, i have only one code, that I will loop through to create all those tabs and gridview. When I apply the sorting, and I click on the column name on any grid, it returned an error saying index was out of bound. BUT, when there is only ONE grid view created, it is working fine, I suspect it mixed up all the grid view's id and so on. But I have assigned different ID to gridview

View 8 Replies View Related

Forms Data Controls :: Showing A Gridview Column Value In A Label Outsite The Gridview?

Dec 28, 2009

I have a gridview where I need to show the value of the 7th column (from the 1st of gridview row) in a label on the page outside the gridview.

View 8 Replies View Related

Forms Data Controls :: Selected Checkbox In Gridview Should Be Added From One To Other Gridview Using Objectdatasource

Aug 2, 2010

table a
a1 a
1 qw
2 asa

i have two grid views

gridview1 has check box[a1] and one value[a](in total two columns) with objectdatasource1 for datareferencing from database

another gridview2 has to select only the selected/checked value of gridview1 of checkbox1

View 3 Replies View Related

Forms Data Controls :: Edit Child Gridview Inside Master Gridview?

Sep 21, 2009

I know there are many posts about master/child gridview. But I have not be able to find a solution to my seemingly basic problem...

I have a child gridview (user control ucChild) nested in each row of a master gridview. When I load the master gridview page, after I bind the data of the master, I go row by row & pass the key to ucChild to bind the details (child gridview).

The child gridview has a edit link - nothing fancy. After user clicks it, the master gridview page and ucChild do their routine including page load and bind data. Then it comes to ucChild's RowEditing method. I do the following:

- set the edit index of the sender (the specific child gridview)

- set sender's datasource, and bind data

But now this child gridview becomes blank...

View 3 Replies View Related

Forms Data Controls :: Click On The Child Gridview And Get The Values Of The Parent Gridview?

Oct 25, 2010

I'm lost. I have a sub gridview in a gridview. In subGridbiview I have a button. How do I can clicking the button and get values outside the gridview? The subgridview not present the events ...

------------------------Gridview 1------------------------------------------

| cell(0) | cell(1) | Cell(2)| Cell(3 - ITEM TEMPLATE) | -
| | | | # # # SubGridview1 ######### -
! x1 | Y1 | Z1 | # Cell(0) ! Button #-
! | | | ######################-
| | | | # # # SubGridview1 ######### -
! x2 | Y2 | Z2 | # Cell(0) ! Button #-
! | | | ######################-

how do I click on the child gridview and get the values of the parent gridview? no events in the child gridview no number indexrow on the parent gridview I'm lost.

View 6 Replies View Related

Forms Data Controls :: Decrypt One Gridview Column Values Before Displaying It In The Gridview?

Mar 8, 2011

I have one filed that is encrypted using Rajindal algorithm and stored in MSSQL db.When I retrieve that column in gridview it's displayed in encrypted. I have the code that decrypts it but the problem is:How can I all loop throw this column values in the gridview and decrypt them all and display it in the gridview decrypted.See my code below:


View 9 Replies View Related

Forms Data Controls :: Gridview Recalculate, Then Repopulate Gridview Without Going Back To Database?

Mar 26, 2010

I want to make sure I go about this in an efficient manner. I have a gridview. On the gridview, I have some columns that are read only values . These values go through calculations based on values in a database. The stored procedure takes information in the database, does some simply calculations (this value * that value / another value type of stuff) then returns a recordset as a datasource for the grid.

Other columns on the gridview have values the users can enter data. I want to be able to provide a recalculate button that will run calculations based on the entered values which will change the readonly values and then repopulate the gridview's read only values without going back to the database. This recalculate button is not the save to the database button. The save to the database button will take the values in the user entered columns and save them to the database. Then, the next time the grid is called, the page calls to the database and loads the grid.

So, what I'm looking to do is allows for recalculations on a gridview, a gridview with about 24 columns and about 1000 rows. My first thought is to create a class that reads the gridview and then applies the business rules, then updates the gridview some how. Or, maybe have a dataset table thats i read the value from the user inputs, then apply business rules and then bind the gridview to the dataset table. Do any of you have thoughts here, maybe have done something like this?

View 9 Replies View Related

Forms Data Controls :: GridView And ObjectDataSource - Column Is Not Shown In The GridView's List ?

Feb 9, 2011

I'm facing a wierd problem with GridView and ObjectDataSource. I bind GridView to my business objects via ObjectDataSource. Everything was working fine until I decided to add a new field in my buisness object and wanted to add a column to GridView to show it. Somehow that column is NOT shown in the GridView's list of available columns. I have tried refreshing schema, rebinding, etc. I'm using GridView inside a user control which is used as a web part. Does that make a difference ?

View 3 Replies View Related

Forms Data Controls :: Child Gridview Within A Master Gridview - Not Showing Info?

Oct 15, 2009

I have a master gridview with a child gridview within a template.

The master shows user information and the child will display information about this user. The info is stored in two seperate databases and there is no need for editing, etc using these gridviews so it's good that they'll only be read-only.

I'm binding the master gridview to an ObjectDataSource pointing to a DAL to populate the master gridview. The DataKeyName is the Participant ID (PartID). This works fine.

The child gridview is bound to another ObjectDataSource as well but it's being populated with the results of whatever the Participant ID (PartID) is; or that's how it should work. The DAL works fine when I test it and enter a PartID, but nothing is being displayed in the child gridview when viewed in a browser.

I've done some reading and it's suggested that this should be done via the RowDataBound event. How do I accomplish this?

View 12 Replies View Related

Forms Data Controls :: GridView Export To Excel Does Not Work When Using The ConfirmButtonExtender In GridView

Apr 1, 2011

I am using Ajax ConfirmButtonExtender Control in GridView for Deleting the Record. I am also Exporting the GridData to Excel using Render Method. But when i click on the Export Button, i am getting below error Extender control 'confirmID' is not a registered extender control. Extender controls must be registered using RegisterExtenderControl() before calling RegisterScriptDescriptors(). Parameter name: extenderControl

View 1 Replies View Related

Forms Data Controls :: How To Get The Textbox Values To Gridview And Gridview To Database

Jul 19, 2010

how to get the values text box values to gridview..

if i enter any text in text box those values should display in gridview.

after entering of 2 or 3 records, i will click on save then all the values of grid should insert in to DAta Base.

i dont want to get the values form Database to Gridview.

how to retrive the values form Database to Gridview.

i just want to display the values which are there in Textbox...

View 3 Replies View Related

Copyrights 2005-15, All rights reserved