View Single Post
  #1 (permalink)  
Old September 29th, 2012, 01:50 AM
rony001 rony001 is offline
Registered User
Points: 15, Level: 1
Points: 15, Level: 1 Points: 15, Level: 1 Points: 15, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2012
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default calculation between datagridview columns

Hi friends
I am trying to learn how to add an expression column in datagridview but its not giving me correct out put
any bit of info would be helpful
Code:
  
    Dim dt As New DataTable
        dt.Columns.Add("col1")
        dt.Columns.Add("col2")
        dt.Columns.Add("col3")
        dt.Columns.Add("col4")
        dt.Columns.Add("total")

        dt.Rows.Add("")
        dt.Rows.Add("")
        dt.Rows.Add("")
        dt.Rows.Add("")

        Me.DataGridView1.DataSource = dt
        dt.Columns("total").Expression = "[col2]+[col3]"
can someone provide me a link or a sample code please

Last edited by rony001; December 1st, 2012 at 03:55 PM..
Reply With Quote