Microsoft Communities

Welcome to WindowsClient.net | Sign in | Join

Here are some frequently asked questions about Windows Forms and their answers.

Windows Forms FAQs

How do I hook up events on the editing control?

Sometimes you will need to handle specific events provided by the editing control for a cell. You can do this by first handling the DataGridView.EditingControlShowing event. Next access the DataGridViewEditingControlShowingEventArgs.Control property to get the editing control for the cell. You might need to cast the control to a specific control type if the event you are interested is not based of the Control class.

NOTE: The DataGridView reuses editing controls across cells if the type is the same. Because of this you should make sure that you do not continuously hook up a new event handler if there is already one hooked up otherwise you your event handler will get called multiple times.



Page view counter