This is a migrated thread and some comments may be shown as answers.

Bubbling GridCommandEventArgs

1 Answer 114 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Paul Bishop
Top achievements
Rank 1
Paul Bishop asked on 14 Aug 2008, 01:03 AM
I have a RadGrid in a web user control.  In the grid I have a a link button.  When the link button is clicked, I capture the ItemCommand event and then want to bubble the event up to the parent page.  The problem I have is that the event will not bubble up because MyRowSelected is always null.  I've tried a few variations of  the code, but here is a snippet of the latest:

public partial class ObjectList : System.Web.UI.UserControl

{

public event EventHandler MyRowSelected;



protected

void rgList_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)

{

if (e.CommandName == "Select")

{

OnMyRowSelected(e);

}

}

protected void OnMyRowSelected(GridCommandEventArgs e)

{

if (MyRowSelected != null)

{

MyRowSelected(

this, e);

}

}
}

1 Answer, 1 is accepted

Sort by
0
Paul Bishop
Top achievements
Rank 1
answered on 14 Aug 2008, 07:05 PM
I figured this one out.  I had to create a delegate for the event and change the event handler declaration.
Tags
Grid
Asked by
Paul Bishop
Top achievements
Rank 1
Answers by
Paul Bishop
Top achievements
Rank 1
Share this question
or