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

The DataGridViewTextBoxEditingControl

Dom
I need to capture an event from the text box that is used to edit a
cell in the DataGridView. So I did the following:

EditingControlShowing (sender, e)
{
TextBox t = (TextBox) e.Control;
t.KeyPress += new KeyPressEventHandler (...)
}

Guess what? The KeyPress handler is triggered multiple times, and it
gets worse every time the EditingControl is shown. I think I know
why, and I think I need to do something like this;

t.KeyPress = null;
t.KeyPress += new KeyPressEventHandler (...)

The problem is, I can't do the first line here. How do I get rid of
the events that are already there?

Dom
Mar 19 '08 #1
0 982

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

Similar topics

3
by: Scott S. | last post by:
I have been searching for a way to have autocomplete in a DataGridTextBox object. There does not appear to be an obvious way to do this like you would for a TextBox outside of a grid using the...
7
by: Ryan | last post by:
I have a DataGridView which displays numeric (Int32) data from an underlying database. I want the numbers to be displayed in numeric format "#,###" (with commas). I want to also limit the user so...
1
by: Gohalien | last post by:
Hello, I am trying to makethat user will be unable to enter a "," in a cell What I was thinking was to make a custom columntype, and indeed, I created it, I have to override OnKeyPress event. ...
1
by: =?Utf-8?B?TGkgUWl1?= | last post by:
Hi, I am trying to get the inserting position of a string within a DataGridViewTextBoxCell in editing mode, based on the cursor point position in selection mode. I used the method...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...
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...

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.