I have a RadGrid list of staff members that opens a web user control for editing. The edit control has a RadDatePicker for selecting a birthdate, and I set the control to today - 21 years when opened if the date picker control is blank. All of this was working fine until I added a RadAjaxManager and paging to my RadGrid. I can remove the RadAjaxManager code from the RadGrid and the OnPopupOpening event works again. Can't I have both ajax enabled paging and be able to set the default date.
Here is my ascx code for the RadGrid list control.
Here are the relevant snippets from my edit control.
Here is my ascx code for the RadGrid list control.
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="uxStaffList"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="uxStaffList" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings></telerik:RadAjaxManager><cc1:IbsRadGridList ID="uxStaffList" runat="server" Factory="StaffFactory" AllowPaging="true" PageSize="20" DeleteButtonVisible="false"> <MasterTableView DataKeyNames="StaffId"> <EditFormSettings UserControlName="StaffEditControl.ascx" PopUpSettings-Width="940px" CaptionDataField="FullName"></EditFormSettings> </MasterTableView></cc1:IbsRadGridList> ... <div class="control-group"> <asp:Label ID="BirthDateLabel" runat="server" CssClass="control-label" AssociatedControlID="uxBirthDate">Birthday</asp:Label> <div class="controls"> <telerik:RadDatePicker ID="uxBirthdate" runat="server" MinDate="1/1/1913" ClientEvents-OnPopupOpening="setDefaultBirthDate"></telerik:RadDatePicker> </div> </div> ...<script type="text/javascript"> function setDefaultBirthDate(sender, e) { if (sender.isEmpty()) { var d = new Date(); d.setFullYear(d.getFullYear() - 21); sender.set_selectedDate(d); } }</script>