Displaying RadDatePicker Dropdown Popup in AjaxControlToolkit ModalPopup Window
Environment
Property | Value |
---|---|
Product | RadDatePicker for ASP.NET AJAX |
Version | all |
Description
When using an AjaxControlToolkit modalpopup window, the RadDatePicker dropdown popup may not be displayed correctly due to its lower z-index.
Solution
To address this issue and ensure that the RadDatePicker dropdown popup is displayed correctly within the AjaxControlToolkit modalpopup window, you can follow these steps:
- Add the following JavaScript code to your page:
function popupOpening(sender, args) {
var popup = args.get_popupControl();
setTimeout(function () {
popup.get_element().parentElement.style.setProperty('z-index', '103000', 'important');
});
}
- Modify your RadDatePicker control by adding the
OnPopupOpening
attribute and set it to thepopupOpening
JavaScript function:
<telerik:RadDatePicker RenderMode="Lightweight" ID="RadDatePicker2" runat="server">
<ClientEvents OnPopupOpening="popupOpening" />
</telerik:RadDatePicker>