473,385 Members | 1,427 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

calculated column in datagrid question

can you populate a colmun in a data grid with a calculated value and can this
be done on databind?

I have a datagrid that is populated with a shopping cart. This data comes
from the database. I have a quantity and price that i'd like to calculate in
a function and show as a line total. What's the best way to do this.
thanks
kes
Nov 19 '05 #1
3 1203
Use a template column and yes, you can do pretty much what you want with it.

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Kurt Schroeder" <Ku***********@discussions.microsoft.com> wrote in message
news:23**********************************@microsof t.com...
can you populate a colmun in a data grid with a calculated value and can
this
be done on databind?

I have a datagrid that is populated with a shopping cart. This data comes
from the database. I have a quantity and price that i'd like to calculate
in
a function and show as a line total. What's the best way to do this.
thanks
kes

Nov 19 '05 #2
If i bind the data directly to the datagrid like this: dgCart.DataSource =
cmdCart.ExecuteReader() how do i reference the data in the itemDataBound sub
if it is not included on in the datagrid as a column? (as a
<asp:boundcolumn...)

"Curt_C [MVP]" wrote:
Use a template column and yes, you can do pretty much what you want with it.

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Kurt Schroeder" <Ku***********@discussions.microsoft.com> wrote in message
news:23**********************************@microsof t.com...
can you populate a colmun in a data grid with a calculated value and can
this
be done on databind?

I have a datagrid that is populated with a shopping cart. This data comes
from the database. I have a quantity and price that i'd like to calculate
in
a function and show as a line total. What's the best way to do this.
thanks
kes


Nov 19 '05 #3
I'd like to avoid including hidden columns if i can

"Curt_C [MVP]" wrote:
Use a template column and yes, you can do pretty much what you want with it.

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"Kurt Schroeder" <Ku***********@discussions.microsoft.com> wrote in message
news:23**********************************@microsof t.com...
can you populate a colmun in a data grid with a calculated value and can
this
be done on databind?

I have a datagrid that is populated with a shopping cart. This data comes
from the database. I have a quantity and price that i'd like to calculate
in
a function and show as a line total. What's the best way to do this.
thanks
kes


Nov 19 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Dan Keeley | last post by:
Hi, I have a dataset which is used to populate my datagrid something like this: My question is, how do I add a caluclated display column to the datagrid? It will be based on ScoreCardScore... ...
1
by: Sean | last post by:
I have a table I am using to load a DataSet.DataTable to display data on a DataGrid. I have a Column called StartTime that is a DateTime and I have a column called Duration that is an Int32, that...
0
by: Manish | last post by:
Hey Guys I am using a datagrid to extract information out of SQL Server datbase. The fields extracted are category,week,budget,Last Year,Forecast and Projection. Also i add a calculated column...
1
by: Manish | last post by:
Hello Everyone I am having weird problem in my datagrid bounded to datatable. My datatable is populated from SQLServer database. DataGrid has Calculated column Week% and Calculated record, SPLH....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.