Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 501931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:14:24+00:00 2026-05-13T06:14:24+00:00

When using a Delegate, I can use Delegate.GetInvocationList() Method to retrieve the invocation list

  • 0

When using a Delegate, I can use Delegate.GetInvocationList() Method to retrieve the invocation list of the delegate at runtime.

Is there a way to access the subscriber list that has been associated with an event? I ran the code from this example (SO#1237001) and the immediate window allowed me to cast the SecondChange event to a System.MultiCastDelegate and then invoke the GetInvocationList method.

However, in my scenario I am working with a System.Windows.Forms.DataGridView and I would like to inspect the invocation list of the CellClick event at runtime. However, when I try any kind of cast on CellClick, I recieve the following error:

The event
‘System.Windows.Forms.DataGridView.CellClick’
can only appear on the left hand side
of += or -=

I can see there are clearly differences in the declarations of these events. In the Clock example the event is declared like this:

public event Func<DateTime, bool> SecondChange;

And in the DataGridView the event is declared like this:

[SRDescription("DataGridView_CellClickDescr"), SRCategory("CatMouse")]
public event DataGridViewCellEventHandler CellClick
{
    add
    {
        base.Events.AddHandler(EVENT_DATAGRIDVIEWCELLCLICK, value);
    }
    remove
    {
        base.Events.RemoveHandler(EVENT_DATAGRIDVIEWCELLCLICK, value);
    }
}

Why can one call GetInvocationList on the Clock example, but not on the DataGridView event? Is there any way for me to get the same type of information from the DataGridView event that GetInvocationList returns?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T06:14:25+00:00Added an answer on May 13, 2026 at 6:14 am

    The whole point of an event it defines (only) an add/remove API (like how a property defines get/set).

    The entire point of an event is that externally you can’t do this (access the subscribers). I’m guessing that in the “clock” example, the code that accesses the list is inside the type that declares the event; that is fine: inside the type, you have full access to the backing implementation (often a delegate field).

    Externally, you should only care about your own handlers, that you already know about because you subscribed them. Attempts to fetch the backer exist, but it is brittle and not recommended. In this case, it uses an EventHandlerList, for example.

    Why do you need this? It usually means that you are doing something wrong (sorry, but it does).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 300k
  • Answers 300k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Entirely untested: public class ViewModelBuilderFactory { public IViewModelBuilder GetViewModelBuilder (string… May 13, 2026 at 7:59 pm
  • Editorial Team
    Editorial Team added an answer "which is embeded in XUL" How? I bet you use… May 13, 2026 at 7:59 pm
  • Editorial Team
    Editorial Team added an answer Depending on what you're trying to do outside of OpenGL,… May 13, 2026 at 7:59 pm

Related Questions

I have come across what must be a common problem. When I have an
Can you create a delegate of an instance method without specifying the instance at
I've been using the BitmapImage.DownloadProgress event to wait until the image is loaded when
My most used mini pattern is: VideoLookup = new ArrayList { new ArrayList {
I have an NSTokenField in a window. I am using it to store tags

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.