Solved

C# How to get DataGridViewCellEventHandler in code via Designer

Posted on 2014-04-21
2
867 Views
Last Modified: 2014-04-22
I have a form which I created via the designer in VS 2008. In my form I have a DataGridView control with some columns in it. Basically whay I am trying to do is implement a DataGridViewCellEventHandler for the CellValueNeeded method via the designer.

I know if one double clicks with in the contorl designer automatically creates a xxx_CellContentClick method in the form's control.cs file along with the DataGridViewCellEventHandler callback in the xxxControlDesigner.cs file.

I want to add DataGridViewCellEventHandlers for CellValueNeeded, CellValuePushed, ColumnHeaderMouseClick and etc.

I thought you where not suppose to directly alter the xxxControlDesinger.cs file so how do these DataGridViewCellEventHandlers end up there that I have seen in other code?

Thanks
0
Comment
Question by:atomicgs12
2 Comments
 
LVL 23

Accepted Solution

by:
Michael74 earned 500 total points
Comment Utility
When you add an event from the designer the appropiate handlers are added for you. Select the Datagridview and in properties change the view to events and then double click. VS will then add the handlers as appropiate

Michael
0
 

Author Closing Comment

by:atomicgs12
Comment Utility
Perfect, thanks.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now