|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Sum of a DataGridView columnOn a Windows form I have a DataGridView. I woulkd like to display the sum of
some of the columns in the DataGridView, but I can't firnd any information on how to do this. Any suggestion on how I can best do this? Thanks in advance. -- Tony Tony A. schrieb:
> On a Windows form I have a DataGridView. I woulkd like to display the sum of I checked the methods that the Grid, Rows, Columns, etc offers but> some of the columns in the DataGridView, but I can't firnd any information on > how to do this. > > Any suggestion on how I can best do this? Thanks in advance. > -- > Tony haven't found anything which can do this... Seems that you have to write your own method :-( Won't be too hard to do this: Just get the columns/cells and do the job within a loop: Dim mySum as Integer = 0 Dim currentRow as DataGridViewRow For Each currentRow In dgvMyGrid.rows mySum += CInt(currentRow.Cells( <CellIndex> ).Value) Next Thanks Norman.
-- Show quoteHide quoteTony "Norman Chong" wrote: > > Tony A. schrieb: > > > On a Windows form I have a DataGridView. I woulkd like to display the sum of > > some of the columns in the DataGridView, but I can't firnd any information on > > how to do this. > > > > Any suggestion on how I can best do this? Thanks in advance. > > -- > > Tony > > I checked the methods that the Grid, Rows, Columns, etc offers but > haven't found anything which can do this... Seems that you have to > write your own method :-( > Won't be too hard to do this: Just get the columns/cells and do the job > within a loop: > > Dim mySum as Integer = 0 > Dim currentRow as DataGridViewRow > For Each currentRow In dgvMyGrid.rows > mySum += CInt(currentRow.Cells( <CellIndex> ).Value) > Next > >
Calculate height in millimeters of a font
Need help re: vb.net windows forms Remoting Having problems with SetWindowText api Bug in Radio Button (or weird feature) system.enum.getvalues Parsing text files Ctype Datasource to DataTable .. always empty? Linking with .OBJ object files Compilation in dot NET |
|||||||||||||||||||||||