p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   VB.NET (http://p2p.wrox.com/forumdisplay.php?f=83)
-   -   calculation between datagridview columns (http://p2p.wrox.com/showthread.php?t=88528)

rony001 September 29th, 2012 01:50 AM

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


All times are GMT -4. The time now is 04:04 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.