473,471 Members | 2,017 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

DataGridView Cell Previous Value

VB.NET 2005 2.0 Framework application is using a DataGridView for SQL
data access and user data entry. As part of exception/error handling,
the app wants to advise the user when he/she enters a value into a DGV
field that is inappropriate; for example, an alpha character in a cell
containing an integer value. When the user types in the alpha and
hits enter, BeginEdit fires off, realizes the cell is dirty, and can
see the previous/old cell .Value, but not the newly entered character/
value. DataError then promptly frags the entry (interdicting
CellValueChanged execution), but again can't say what value/
character(s) the user entered that were inappropriate. Since the
entered characters persist on the DGV (until .CancelEdit and .EndEdit
are called), they must be somehow accessible; can anyone explain how
to grab them?

Thanks for your help!

Oct 29 '07 #1
1 10216
Hey Roach,

If you handle validation on a cellular level you can access the formatted
value or cancel the validation and value being changed at all...

look into the DataGridViewCellValidatingEventArgs and the CellValidating()
method of the DGV:
http://msdn2.microsoft.com/en-us/lib...rs(VS.90).aspx

HTH
Brendon

"Roach" <TL*****@uss.comwrote in message
news:11**********************@v3g2000hsg.googlegro ups.com...
VB.NET 2005 2.0 Framework application is using a DataGridView for SQL
data access and user data entry. As part of exception/error handling,
the app wants to advise the user when he/she enters a value into a DGV
field that is inappropriate; for example, an alpha character in a cell
containing an integer value. When the user types in the alpha and
hits enter, BeginEdit fires off, realizes the cell is dirty, and can
see the previous/old cell .Value, but not the newly entered character/
value. DataError then promptly frags the entry (interdicting
CellValueChanged execution), but again can't say what value/
character(s) the user entered that were inappropriate. Since the
entered characters persist on the DGV (until .CancelEdit and .EndEdit
are called), they must be somehow accessible; can anyone explain how
to grab them?

Thanks for your help!
Oct 29 '07 #2

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

Similar topics

1
by: Arvind | last post by:
Hi I edit a cell in a DataGridView, and then would move to another cell in the DataGridView using mouse. Then the DataGridView as of now does scroll down to the last visited cell. But when I try...
5
by: bob | last post by:
Now this ought to be a simple matter. But nothing's simple in the Net world, I'm finding. In vb6 you could use "!" to force text to upper case in the format function. I've searched the vb.net...
1
by: Riley | last post by:
Need some help. I am using datagridview in 2005 with C#. I am calling a web service and filling the datagridview with the data returned. This all works fine. Next step is to take a value from one...
3
by: Henry Jones | last post by:
I am using VB.NET VS 2005 and I have a datagridview bound to a table. This table has rate information on bank loans. The fiels are ProductName, MinDeposit, Rate, and PreviousRate On the grid...
3
by: Daniel Manes | last post by:
I need a strategy to debug this situation... I can't put all the code involved, but here are some of the critical lines with comments: ------------------------- Private _parentDataCell As...
0
by: =?Utf-8?B?S3VtYXIuQS5QLlA=?= | last post by:
I edit a cell in a DataGridView, and then would move to another cell in the DataGridView using mouse. Then the DataGridView as of now does scroll down to the last visited cell. But when I try to...
4
by: NvrBst | last post by:
I have a log viewer. I sort the DataGridView by the Time Column and then run a function to set all cell backcolors depending if the cell above is different. This works correctly, however, when...
1
by: TG | last post by:
Hi! I have an application in which I have some checkboxes and depending which ones are checked those columns will show in the datagridview from sql server or no. After that I have 2 buttons:...
0
by: priyamtheone | last post by:
I'm trying to make a datagridview column to act like a datetimepicker column (C#.Net 2005). These are the behaviours that the dgv should have: 1) Initially all the cells of the dtp column should be...
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
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...
1
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...
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.