473,756 Members | 3,111 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1842
Hi Blake,

In DataGrid.Update Command, DataGrid.EditIt emIndex can be retrieved before
it is set to -1. Therefore, we can use
dataset.Tables[0].Rows[DataGrid.EditIt emIndex][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.Update Command Event
<http://msdn.microsoft.com/library/de...-us/cpref/html
/frlrfsystemwebu iwebcontrolsdat agridclassupdat ecommandtopic.a sp>

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.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: aux-217-3-232.dallas.net 209.217.3.232
| Path: cpmsftngxa06.ph x.gbl!TK2MSFTNG P08.phx.gbl!TK2 MSFTNGP09.phx.g bl
| Xref: cpmsftngxa06.ph x.gbl microsoft.publi c.dotnet.framew ork.aspnet:1670 80
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.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
7672
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 do however what I would require is that when the user right clicks that the record pointer moves to the nearest record to the mouse pointer so that I can give the user of editing the data. I do not want them to edit the data directly on the grid...
3
2213
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 edit mode no pronlem, however when I change the data in the edit cell it is not picking up the newly typed value, it passes back the original value. eg, the orgincal value is
2
2507
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 the OID of Person), the information of the person matching the selected OID is shown in the Textboxes (Name, Address, id, etc) and the courses this person is taken are shown in a DataGrid (course name, price, etc.). This is working well so far, I...
0
1045
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 pulled from the textbox is the original value it had before editing. It "feels" like I'm just missing some setting, but am newbie enough to not be able to find what that might be. I'm not requering/rebinding the grid data between beginning the...
1
1907
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 TabControl - mainly a grid on one tab, and a checkboxlist on the other, that coordinate back and forth, so (un)checking a box will hide or show a column on the grid. In addition, I would like the flexibility of adding a DataSource at design time...
1
2623
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. Included in the application program is a data “GRID” which I believe was created using Visual Basic, not standard Access. Its purpose is to display the results of a range of “from-to-dates” of registrations for different clients. The difficulty...
1
14314
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. Both the grid and the dropdown box are retrieving and displaying data fine, I just cant bind the two together. I followed the instructions in the help document called 'Walkthrough: Displaying a Drop-Down List While Editing in the GridView Web...
9
1664
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 sure.) I did see the DataGrid control but that seems oriented to DB usage. It's probably much more complex than what I need, but I'm not sure about that!
2
14772
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 the DataError event and just doing nothing in the circumstance that caused the error. Here's my situation: I would like to allow the user to EITHER select an item from the ComboBox (in a DataGridView) OR type in a new value of their own.
0
9152
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9716
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9716
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
9571
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8569
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4996
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5180
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3676
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
3
2542
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.