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

  • Thread starter Thread starter Blake Versiga
  • Start date Start date
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
 
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
|
|
|
 
Back
Top