I have a Telerik RadGrid which uses the EditFormSettings like this:
<EditFormSettings EditFormType="WebUserControl" UserControlName="~/UserControls/MyUserControl.ascx" >
<EditColumn ButtonType="ImageButton" />
</EditFormSettings>
Within MyUserControl.ascx, I have a button which I'd like to trigger an event handler when clicked. The two ways I know of doing this are as follows:
1. `OnClick="btnOkay_Click"` as a button attribute, where the event handler is in the code behind
2. `CommandName="Update"` as a button attribute, where this is handled by the event handler passed into the OnUpdateCommand attribute of the RadGrid
Both of these work. However my problem is that they stop working when the RadGrid is within a user control within a `Repeater` ASP.NET control. In this case, the button event handlers do not get fired (in either of the methods above).
I notice that when I bind my repeater:
rpt.DataSource = Data
rpt.DataBind()
If I wrap that in a `if(!Page.IsPostBack)`, then the edit form doesn't appear at all when I click on the RadGrid row's edit link. So I had to remove that `IsPostBack` check. I don't think think this is the cause of my problem, as I've tried explicitly not doing this when clicking my update button (by breaking into the debugger). I just thought I'd mention it incase it was related.
Can anyone think of a reason why this would break in a Repeater?
<EditFormSettings EditFormType="WebUserControl" UserControlName="~/UserControls/MyUserControl.ascx" >
<EditColumn ButtonType="ImageButton" />
</EditFormSettings>
Within MyUserControl.ascx, I have a button which I'd like to trigger an event handler when clicked. The two ways I know of doing this are as follows:
1. `OnClick="btnOkay_Click"` as a button attribute, where the event handler is in the code behind
2. `CommandName="Update"` as a button attribute, where this is handled by the event handler passed into the OnUpdateCommand attribute of the RadGrid
Both of these work. However my problem is that they stop working when the RadGrid is within a user control within a `Repeater` ASP.NET control. In this case, the button event handlers do not get fired (in either of the methods above).
I notice that when I bind my repeater:
rpt.DataSource = Data
rpt.DataBind()
If I wrap that in a `if(!Page.IsPostBack)`, then the edit form doesn't appear at all when I click on the RadGrid row's edit link. So I had to remove that `IsPostBack` check. I don't think think this is the cause of my problem, as I've tried explicitly not doing this when clicking my update button (by breaking into the debugger). I just thought I'd mention it incase it was related.
Can anyone think of a reason why this would break in a Repeater?