Solved

sum selected cells in a datagridview

Posted on 2006-11-21
1
1,265 Views
Last Modified: 2010-05-18
Hi Experts

In VB 2005 I have a datagridview and I need to be able to sum selected cells and put the total into a textbox
can anyone help !

dizzycat
0
Comment
Question by:dizzycat
1 Comment
 
LVL 14

Accepted Solution

by:
Ramuncikas earned 250 total points
Comment Utility
       Dim Total As Long = 0
        For Each Cell As DataGridViewCell In Me.DataGridView1.SelectedCells
            Total += Convert.ToInt64(Cell.Value)
        Next
        Me.TextBox1.Text = Total
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now