ei guys how to compute values in a datagrid column.. we have just tried some codes but it appers false anyway.. just need it badly.. i just have 30 min. :CCC
HOW TO COMPUTE VALUES in a DATAGRID COLUMN
Page 1 of 15 Replies - 3519 Views - Last Post: 12 October 2011 - 08:38 AM
Replies To: HOW TO COMPUTE VALUES in a DATAGRID COLUMN
#2
Re: HOW TO COMPUTE VALUES in a DATAGRID COLUMN
Posted 12 October 2011 - 02:19 AM
What do you want to compute? do the loop fails? What you have tried that fails?
We need to know so we can help........ Just Idea, I can loop through the column like:
We need to know so we can help........ Just Idea, I can loop through the column like:
For i As Integer = 0 To DGV.RowsCOunt - 2 'DGV.Rows(i).Cells(0).Value <---This will give all values of the first column Next
#3
Re: HOW TO COMPUTE VALUES in a DATAGRID COLUMN
Posted 12 October 2011 - 02:55 AM
label.text = me.datagridview.currentcell.value
this is our code.. but it just display what you have click.. how to do it if it is multiple..? (selectec cells)
this is our code.. but it just display what you have click.. how to do it if it is multiple..? (selectec cells)
#4
Re: HOW TO COMPUTE VALUES in a DATAGRID COLUMN
Posted 12 October 2011 - 03:07 AM
As I said, looping. You have to loop through all selected cells, like this:
For Each x2 As DataGridViewTextBoxCell In DataGridView1.SelectedCells
'do something
Next
#5
Re: HOW TO COMPUTE VALUES in a DATAGRID COLUMN
Posted 12 October 2011 - 08:17 AM
Dim netpay As Double
For total As Integer = 0 To Me.DataGridView.RowCount - 1
netpay += Convert.ToDouble(DataGridView.Rows(total).Cells(3).Value)
Next
nettotal.Text = netpay.ToString()
this is our code.. it computes the other row of numbers but not the one we want to be computed.. what would we change or remove.?
For total As Integer = 0 To Me.DataGridView.RowCount - 1
netpay += Convert.ToDouble(DataGridView.Rows(total).Cells(3).Value)
Next
nettotal.Text = netpay.ToString()
this is our code.. it computes the other row of numbers but not the one we want to be computed.. what would we change or remove.?
#6
Re: HOW TO COMPUTE VALUES in a DATAGRID COLUMN
Posted 12 October 2011 - 08:38 AM
FIXED! JUST AN ERROR WITH MY DATA . THANKS ANYWAY.
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|