473,399 Members | 3,656 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,399 software developers and data experts.

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

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
Nov 17 '05 #1
1 1824
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][i] 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/de...-us/cpref/html
/frlrfsystemwebuiwebcontrolsdatagridclassupdatecomm andtopic.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: <#9**************@TK2MSFTNGP09.phx.gbl>
| 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!TK2MSFTN GP09.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
|
|
|

Nov 17 '05 #2

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

Similar topics

0
by: Amrik Singh | last post by:
HI Folks Newbie here, I have an ado control hidden on my form and an associated datagrid with an sql query which retrieves the data that I want. I now want to create a popup menu which I can...
3
by: Brett Hargreaves | last post by:
Hi, I'm having trouble with the datagrid update command. I have a datagrid called grid that poulates itself with data in the page load event. When I click the edit button it takes me into...
2
by: Josef Meile | last post by:
Hi, I'm using a ComboBox, some Textboxes, and a DataGrid to represent a many-to-many relationship between Person and Course. Each time that I change the value in the ComboBox (which for now is...
0
by: John Spiegel | last post by:
Hi all, As usual, I have found a way to make the straightforward, textbook example fail. I have a datagrid that supports editing. When I edit a row then fire the update, the value that gets...
1
by: ben m | last post by:
Hi all - we've recently switched up to 2005, and I'm having trouble getting the hang of some things, among them, creating a control for the project. Currently, we use a combination of controls on a...
1
by: John Phelan-Cummings | last post by:
When I add the name of a new individual in a, bound form, it will not display that person’s name in a label control of a second unbound form. I have a scheduling program that I am working on. ...
1
by: CorporateCoder | last post by:
Hi, I am trying to bind the selected value of a databound dropdown box in a databound gridview control to the value being displayed in the template column the dropdown box has been added to. ...
9
by: active | last post by:
I need a control that displays a grid of rectangles. That is, like a brick wall except the rectangles are lined up. In VB6 I used such a control (may have been called FlexGrid but I'm not...
2
by: =?Utf-8?B?RHJEQkY=?= | last post by:
I understand that the Value put into a DataGridViewComboBoxCell has to be a member of the Items list or an exception is thrown. I also understand that you can override that exception by handling...
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: 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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.