DataGridView, Custom Columns

W

Wayne Gibson

Hi,
I'm using the DataGridViewTextBoxColumn and I'm trying to find a way to
detect when the a key is pressed whilst it is being edited. But there
doesn't appear to be any events for this..

So I was wondering if anybody had written any custom columns to catch these
events.

Thanks

Wayne
 
L

Lars Behrmann

Hi Wayne,

if you use a DataTable as DataSource you
could register the ColumnChanging event. You will
recieve than a DataColumnChangeEventArgs object
over his properties Column and Row you can get
all information.

Hope that helps ;)

Cheers
Lars Behrmann

_________________
Nothing is impossible. UML is the key for all your problems.
AODL - Make your .net apps OpenOffice ready
http://aodl.sourceforge.net/
 
F

Frank Dzaebel

Hello Wayne,
I'm using the DataGridViewTextBoxColumn and I'm trying to find a way to
detect when the a key is pressed whilst it is being edited. But there
doesn't appear to be any events for this..
So I was wondering if anybody had written any custom columns to catch these
events.

For example this is simply possible if you override the event for the
TextBox of the derived DataGridTextBoxColumn in the constructor:

public MyTextBoxColumn() //derived from DataGridTextBoxColumn
{ this.TextBox.KeyDown += new KeyEventHandler(TextBox_KeyDown);
} // ... and the Handler accordingly


ciao Frank
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top