Results 1 to 2 of 2

Thread: unbound column doesn't show result

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2013
    Posts
    3

    unbound column doesn't show result

    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
    Last edited by michel vervoort; May 8th, 2013 at 06:59 PM.

  2. #2
    PowerPoster dunfiddlin's Avatar
    Join Date
    Jun 2012
    Posts
    8,245

    Re: unbound column doesn't show result

    If you always show this why don't you just add an expression column to the database table and then you won't ever need anything this convoluted?
    As the 6-dimensional mathematics professor said to the brain surgeon, "It ain't Rocket Science!"

    Reviews: "dunfiddlin likes his DataTables" - jmcilhinney

    Please be aware that whilst I will read private messages (one day!) I am unlikely to reply to anything that does not contain offers of cash, fame or marriage!

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width