How can i get the previous value of a control when editing a data grid?

B

Blake Versiga

When editing a datagrid (C#)
I need to know if the user changed the value of cell AND what the previous
value was.

Is this possible? If so how do I get the previous value or at least if the
cell has changed?

TIA
Blake
 
L

Lewis Wang [MSFT]

Hi Blake,

In DataGrid.UpdateCommand, DataGrid.EditItemIndex can be retrieved before
it is set to -1. Therefore, we can use
dataset.Tables[0].Rows[DataGrid.EditItemIndex] to get the previous value
of the cell. Then, we can check if the user changed the value of the cell.

The following link may be helpful:
DataGrid.UpdateCommand Event
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html
/frlrfsystemwebuiwebcontrolsdatagridclassupdatecommandtopic.asp>

Does this answer your question? Please let me know if you need more
information.

Best regards,
Lewis

This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
| From: "Blake Versiga" <.>
| Subject: How can i get the previous value of a control when editing a
data grid?
| Date: Tue, 12 Aug 2003 08:22:37 -0500
| Lines: 11
| X-Priority: 3
| X-MSMail-Priority: Normal
| X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
| Message-ID: <#[email protected]>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| NNTP-Posting-Host: aux-217-3-232.dallas.net 209.217.3.232
| Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09.phx.gbl
| Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:167080
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| When editing a datagrid (C#)
| I need to know if the user changed the value of cell AND what the previous
| value was.
|
| Is this possible? If so how do I get the previous value or at least if the
| cell has changed?
|
| TIA
| Blake
|
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top