Results 1 to 5 of 5

Thread: Arithmetic In Datagridview Rows

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2014
    Posts
    30

    Question Arithmetic In Datagridview Rows

    Brief : I need to add Column1 + Column2 And Display Result In Column3
    But I need to do it for all rows in column3 automatically. I need a very short code.

    Thankyou.

  2. #2
    Frenzied Member dolot's Avatar
    Join Date
    Nov 2007
    Location
    Ancient City, U.S.
    Posts
    1,254

    Re: Arithmetic In Datagridview Rows

    How are column1 and column2 going to be populated? Will the user be entering these values or will you be loading them from a database?
    I always add to the reputation of those whose posts are helpful, and even occasionally to those whose posts aren't helpful but who obviously put forth a valiant effort. That is, when the system will allow it.
    My war with a browser-redirect trojan

  3. #3
    Still learning kebo's Avatar
    Join Date
    Apr 2004
    Location
    Gardnerville,nv
    Posts
    3,762

    Re: Arithmetic In Datagridview Rows

    assuming you are using a data bound table to populate the grid, create a new column in the data table and set its expression property to "Column1 + Column2". Here is a link to the expression property documentation. http://msdn.microsoft.com/en-us/libr...v=vs.110).aspx
    Process control doesn't give you good quality, it gives you consistent quality.
    Good quality comes from consistently doing the right things.

    Vague general questions have vague general answers.
    A $100 donation is required for me to help you if you PM me asking for help. Instructions for donating to one of our local charities will be provided.

    ______________________________
    Last edited by kebo : Now. Reason: superfluous typo's

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jan 2014
    Posts
    30

    Re: Arithmetic In Datagridview Rows

    I will load data from a csv file.

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Arithmetic In Datagridview Rows

    Quote Originally Posted by Thasarath View Post
    I will load data from a csv file.
    Then load the contents of the CSV file into a DataTable and then do as kebo suggested.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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