Link to home
Start Free TrialLog in
Avatar of sandeep437
sandeep437

asked on

datagrid column

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
ASKER CERTIFIED SOLUTION
Avatar of RonaldBiemans
RonaldBiemans

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sandeep437
sandeep437

ASKER

ok i will try it.


tx
sandeep
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!
'fill your dataset with following querry it will solve your problem
select GrossAmt,NetAmt,GrossAmt-NetAmt as [Difference] from table_name