Solved

datagrid column

Posted on 2004-09-21
7
198 Views
Last Modified: 2010-04-23
hi

    I have a datagrid with three columns.

Gross Amt.        Net Amt.      Difference.

I have to display in the Difference column the difference between GrossAmt and Net Amt.      How to do it.


tx
sandeep
0
Comment
Question by:sandeep437
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 25

Accepted Solution

by:
RonaldBiemans earned 125 total points
ID: 12112095
Lets assume you have a dataset with a datatable

        ds.Tables(0).Columns("difference").Expression = "GrossAmt - NetAmt"
0
 

Author Comment

by:sandeep437
ID: 12112106
ok i will try it.


tx
sandeep
0
 
LVL 7

Expert Comment

by:J_Mak
ID: 12118410
Try this:

Dim row1 as Datarow = ds.Tables("Name of your table").Row("whichever row you want")
ds.Tables("Name of your table").Columns("Difference") = row1("Gross Amt") - row1("Net Amt")

I hope that helps!
0
 
LVL 2

Expert Comment

by:ahmadfuwad
ID: 12120311
'fill your dataset with following querry it will solve your problem
select GrossAmt,NetAmt,GrossAmt-NetAmt as [Difference] from table_name
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question