I am trying to ajaxify links in a gridview. When I add the OnItemCreated event hander, I get the error:
I have predefined AjaxSettings in the RadAjaxManager. I found that if I remove them, I don't get the error. Shouldn't it be possible to have defined ajax settings as well as dynamically added them in code behind?
This works:
This doesn't work:
Collection was modified; enumeration operation may not execute.
I have predefined AjaxSettings in the RadAjaxManager. I found that if I remove them, I don't get the error. Shouldn't it be possible to have defined ajax settings as well as dynamically added them in code behind?
protected void uxGrid_OnItemCreated(object sender, GridItemEventArgs e) |
{ |
if (e.Item is GridDataItem) |
{ |
GridDataItem item = (GridDataItem)e.Item; |
LinkButton lnkAddParticipant = (LinkButton)item["TemplateColumn"].FindControl("lnkAddParticipant"); |
RadAjaxManager1.AjaxSettings.AddAjaxSetting(lnkAddParticipant, uxGrid, null); |
} |
} |
This works:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest"> |
<AjaxSettings> |
</AjaxSettings> |
</telerik:RadAjaxManager> |
This doesn't work:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest"> |
<AjaxSettings> |
<telerik:AjaxSetting AjaxControlID="btnLoadRooms"> |
<UpdatedControls> |
<telerik:AjaxUpdatedControl ControlID="uxGrid" /> |
</UpdatedControls> |
</telerik:AjaxSetting> |
</AjaxSettings> |
</telerik:RadAjaxManager> |