473,569 Members | 2,839 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Calculated Columns in a Datagrid

I have a table I am using to load a DataSet.DataTab le 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 contains minutes. I want to create a calculated column that adds the minutes to the StartTime and is called EndTime. Any thought on how to go about doing this?
Nov 20 '05 #1
1 1303
Hello-

Add a column to your DataTable and set its Expression property. Check out
this topic:

Creating Expression Columns (.NET Framework Developer's Guide)
http://msdn.microsoft.com/library/en...tingexpression
columns.asp
Hope this helps,
Steve Stein
VB Team
--

This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
| Thread-Topic: Calculated Columns in a Datagrid
| thread-index: AcP7I8x/XpIm1JliSYOGKuO Bo35KNQ==
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.vb
| From: "=?Utf-8?B?U2Vhbg==?=" <an*******@disc ussions.microso ft.com>
| Subject: Calculated Columns in a Datagrid
| Date: Tue, 24 Feb 2004 14:16:06 -0800
| Lines: 1
| Message-ID: <C6************ *************** *******@microso ft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.publi c.dotnet.langua ges.vb
| Path: cpmsftngxa06.ph x.gbl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.langua ges.vb:184481
| NNTP-Posting-Host: tk2msftcmty1.ph x.gbl 10.40.1.180
| X-Tomcat-NG: microsoft.publi c.dotnet.langua ges.vb
|
| I have a table I am using to load a DataSet.DataTab le 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 contains minutes. I want to
create a calculated column that adds the minutes to the StartTime and is
called EndTime. Any thought on how to go about doing this?
|

Nov 20 '05 #2

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

Similar topics

8
19530
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... Dim Cmd As OleDbCommand = New OleDbCommand("Select AuditDate, ScoreCardScore, DetailsScore from Audits where SupplierID = " &...
1
1919
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. An example of datagrid is Category Amount Week% Revenue 200 Cost 60 30 Hours 100
2
6002
by: Unforgiven | last post by:
Hello All, I have the following query... SELECT Demographics.Full_Name, Demographics.Year_of_birth, Status.Status_OK, SUM(2004 - Demographics.Year_of_birth) AS Age FROM Demographics INNER JOIN Status ON Demographics.PrimaryKey = Status.PrimaryKey
0
1077
by: samir | last post by:
hi i have a datagrid where i display some columns. i want to have some columns from the db and 2 i calculate,i can display it but problem is how to sort the calculated columns. here is what i am doing right now: on page load i have: If Not Me.IsPostBack Then strSQL = "select FILEID, FILENAME, APPSERVICETYPE,LOCATION,FILEREPORT,...
0
7695
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7612
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7922
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7668
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3637
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2111
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1209
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
936
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.