Solved

C# How to get DataGridViewCellEventHandler in code via Designer

Posted on 2014-04-21
2
876 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
ID: 40013804
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
ID: 40015245
Perfect, thanks.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Resolve Dependency Issues 4 42
Angular JS Route 3 45
What .NET URL re-routing tool did I use? 2 34
Help with C#, MVC, razor. 6 18
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

932 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

11 Experts available now in Live!

Get 1:1 Help Now