Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2012 unbound column doesn't show result

$
0
0
Hi,

VB newbe looking for some help. :)
i have a datagrid with 8 columns (id, ean, name, description, price, totalprice, a spacer column and vat)

i like to show a calculated column in a datagrid showing price inc. vat (totalprice)
So i created a unbound column wich is on index 5 and when i try to populate that column it doesn't show the results.


Code:


        For Each r As DataGridViewRow In Me.dataGridProducts.Rows
 
            TotaalPrijs = r.Cells(4).Value + (r.Cells(4).Value * r.Cells(8).Value / 100)
            r.Cells(5).Value = totaalPrijs
                 
 

        Next

when i use the index of any other bound column it shows me the result in the wrong column (category column)



Code:

        For Each r As DataGridViewRow In Me.dataGridProducts.Rows
 
            TotaalPrijs = r.Cells(4).Value + (r.Cells(4).Value * r.Cells(8).Value / 100)
            r.Cells(6).Value = totaalPrijs
                 
 

        Next

Any help would be appriciated

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>