Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB.NET
|
VB.NET General VB.NET discussions for issues that don't fall into other VB.NET forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 29th, 2012, 01:50 AM
Registered User
 
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..





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to add columns more columns to a table lizanta BOOK: Beginning ASP.NET 4 : in C# and VB 3 August 7th, 2011 01:30 PM
Format DataGridView Columns using script Lennie Visual Studio 2008 0 February 16th, 2010 04:27 PM
How to do calculation between 2 tables hwsc SQL Language 2 January 13th, 2005 09:29 PM
Calculation Grantm Access 3 February 16th, 2004 10:14 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.