Solved

datagrid column

Posted on 2004-09-21
7
193 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
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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

706 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now