Dynamically adding a new row & assigning total values of the existing row columns in a grid view

Hi All,

My web application has a aspx(C#) file which shows the report data in a  grid view.  the grid has first two coulmns fixed and columns 3 & onwards are dynamically generated.

What I want - A new row at the end of grid should be added dynamically which should display the total of each column 3 onwards.

Any help would be much appreciated. 

Thanks,

Srain.

 

 

0
srain_sql
7/14/2008 3:21:23 PM
asp.net.presentation-controls 72751 articles. 3 followers. Follow

2 Replies
770 Views

Similar Articles

[PageSpeed] 51

0
Klev
7/14/2008 3:57:32 PM

If you need three dynamic columns total to be displayed then declare three Global valibales and In RowDataBound event try like this

 If (e.Row.RowType = DataControlRowType.DataRow) Then

     Variable1 += Integer.Parse(e.Row.Cells(2).Text)
     Variable2 += Integer.Parse(e.Row.Cells(3).Text)
     Variable3 += Integer.Parse(e.Row.Cells(4).Text)

 Else (e.Row.RowType = DataControlRowType.Footer) 
     e.Row.Cells(2).Text =     Variable1.Tostring() 
     e.Row.Cells(3).Text =     Variable2.Tostring() 
     e.Row.Cells(4).Text =     Variable3.Tostring() 

End If


             


If it solves your issue please mark this posting as "Answered".

Thanks.
0
marx
7/14/2008 4:06:35 PM
Reply:

Web resources about - Dynamically adding a new row & assigning total values of the existing row columns in a grid view - asp.net.presentation-controls

iPhone 5 A6 chip to dynamically up-clock up to 1.3GHz (and downclock too)?
Interesting video from our friends at TLDToday: If this is not just a Geekbench app glitch, it could indicate why that A6 processor is so 2X ...

Apple's Lightning port dynamically assigns pins to allow for reversible use
... a closer look at how Apple's new Lightning connector works, and has come to the conclusion that the 8 pins on each side of the plug are dynamically ...

iPhone 5 Lightning port dynamically reassigns pins
... of Apple's Lightning USB cable shows that the pins on the plug aren't arranged symmetrically, suggesting that the Lightning port can dynamically ...

Urlbox Launches Screenshots-as-a-Service Platform to Dynamically Update Galleries
... changes. Launched yesterday, Urlbox allows anyone with a gallery displaying website screenshots to automate the process and keep them dynamically ...

Everything.me launcher dynamically adapts to what you’re doing right now
... phone according to what you’re doing. Perform a search for ‘football’ and your background will change to the NFL logo. A launcher that dynamically ...


A YouTube Experiment Resizes the Player Dynamically
There's a new YouTube experiment that changes the video player's size, depending on the browser window's size. When resizing Chrome's window, ...

Apple Granted “Dynamically Changing Cursor for User Interface” Patent, Originally Filed in 2003
... a utility patent that covers the use of the mouse cursor that changes according to the context of the task it is engaged in. Called a “Dynamically ...

Atmel's FPSLIC II Dynamically Reconfigurable SoC Supports "Silicon-Sharing" For Peripherals & Interfaces ...
Silicon-Sharing Fits 200K Gate Design into 40K Gate FPSLIC II's, Cuts Power Drain by 97%

Everything.me Launcher Wants to Dynamically Change Phones Based on Location, Interests, and Mental State ...
What if your phone’s launcher dynamically changed based upon interests, your location, or topics you had in mind at a specific moment? A new ...

Resources last updated: 1/19/2016 10:49:26 AM