473,395 Members | 1,670 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,395 software developers and data experts.

OnValidating in editing control

Hi,

I made my own DataGridViewEditingControl, DataGridViewCell and
DataGridViewColumn.
Is it possible to use an Onvalidating event in an editing control in a
datagridview?
I wrote something like this:
Code:

Protected Overrides Sub OnValidating(ByVal e As
System.ComponentModel.CancelEventArgs)
MyBase.OnValidating(e)
If Me.Text <String.Empty Then
If Me.Text <"CORRECT"
e.Cancel = True
End If
End If
End Sub

But when tabbing out the cell it gets executed twice plus that the incorrect
value in the cell remains and the I can continue to edit in other cells.The
event is correctly handled when I click somewhere else with the mouse (being
the cursor remaining in the cell until a correct value is given).

Do I need to do something special when the tab key is pressed.

Any help is appreciated.

Thanks in advance.
Jul 7 '06 #1
0 866

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

Similar topics

2
by: NewBob | last post by:
Since Access automatically highlights all of the text in a text control (I use it to hold data from a memo field) when the control is activated, I've added the following code to put the cursor at...
2
by: Jim | last post by:
Is it possible to determine where the focus is going in or before the OnValidating event has been processed? I know you can ge the window recieveing focus in the LostFocus event (WM_KILLFOCUS)...
1
by: BuddyWork | last post by:
Hello, How can I trigger the OnValidating event for a TextBox from another Form? Say Form1 has TextBox, Form1 is loaded modaless and Form2 is loaded Modaless but I want to run the TextBox...
0
by: BuddyWork | last post by:
Hello, Here is the problem, My code exists out of the TextBox.OnValidating event cleanly because the user has click on a menu that allows the user to load another screen, when that screen is...
0
by: BuddyWork | last post by:
Hello, Here is the problem, My code exists out of the TextBox.OnValidating event cleanly because the user has click on a menu that allows the user to load another screen, when that screen is...
2
by: Vern | last post by:
I have a custom control which has it's own OnValidating event handler. I would like to skip the validations if the Cancel/Exit button is pressed. Also, if possible, would like to skip the...
0
by: Vern | last post by:
I have a custom control which has it's own OnValidating event handler. I would like to skip the validations if the Cancel/Exit button is pressed. Also, if possible, would like to skip the...
1
by: Vern | last post by:
I know that I can get it to run but setting the focus to that control, and then to another control that causes validation, but I'm wondering if I can trigger that event for a control without using...
4
by: helenwheelss | last post by:
Access 2003, using a bound form. I'm seeing rather annoying behaviour when editing data in a control with a default value. It only happens when the form is on a new record. A specific...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...
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
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
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...

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.