user control in a datagrid does not work with a delegate and event

Discussion in 'ASP .Net Datagrid Control' started by David Cho, Oct 10, 2003.

  1. David Cho

    David Cho Guest

    Hi, I have a user control that raises an event which works perfectly
    outside a datagrid. But trying to do this within a datagrid causes
    some problems.

    Here is what I have. For the given datagrid, in the event handler for
    ItemDataBound, I have

    enable_disable userContentEnableDisable =
    (enable_disable)e.Item.FindControl("userContentEnableDisable");

    //tying handler to the event
    userContentEnableDisable.OnSelectionModeChange += new
    enable_disable.SelectionModeChangeHandler(userContentEnableDisable_OnSelectionModeChange);

    Then when I perform an action that raises an event, I get the
    System.NullReferenceException.

    Again, this user control's delegate and event work without a problem
    outside the datagrid. Any ideas?
    David Cho, Oct 10, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. George K
    Replies:
    3
    Views:
    1,720
    John Saunders
    Nov 25, 2003
  2. Replies:
    1
    Views:
    3,749
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN
    Sep 19, 2005
  3. cindy
    Replies:
    0
    Views:
    415
    cindy
    Sep 9, 2008
  4. Replies:
    1
    Views:
    1,689
    Evan Freeman
    Sep 12, 2008
  5. cindy
    Replies:
    0
    Views:
    284
    cindy
    Sep 8, 2008
Loading...

Share This Page