Wednesday, July 30, 2008

RadComboBox not working within a ModalPopupExtender

I just figured out a problem I was having with a Telerik RadComboBox within a ModalPopupExtender and I thought I would share. The Extender worked fine, but when I clicked on the ComboBox the sliding drop down would not show. Turns out all the controls were working just fine, it was a CSS problem. By default the ModalPopupExtender div is set to a z-index of 100001. The RadComboBox slide div is set to a z-index to 6000. Essentially, the slide div was under the popup div. You can fix the problem by boosting the z-index of the slide div. I did it with jQuery:
$(document).ready(function ()
{
 $("div.rcbSlide").css('z-index', 100002);    
});

13 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Ah another convert!

    Why do you need jQuery for that? Can't you just specify it in your sheet?

    ReplyDelete
  3. @Chris

    At first I did it with jQuery, but you're right. I could just do it with the sheet. Probably would be more efficient. But, when I tried it didn't work. For the sake of time, I left it in jQuery.

    ReplyDelete
  4. You can use ZIndex property of RadComboBox, i.e. ZIndex="100002".

    ReplyDelete
  5. Thanks Justin, this worked excellent for me :)

    ReplyDelete
  6. Thanks Justin. I was having a slightly different problem using a Devexpress ASPxPopupControl with RadComboBox in a scrollable div/panel. Using the cssClass='rcbSlide' with JQuery $('div.rcbSlide').css('marginTop', $(div/panel).attr('scrollTop')) was able to slide the dropElement down to the appropriate height. *This is a problem with Mozilla Firefox

    ReplyDelete
  7. Thnx Justin. You post really helped me getting out of this problem.

    Regards,
    Wasif Ehsan,
    Pakistan.

    ReplyDelete
  8. Thanks... this saved me a load of work!

    ReplyDelete
  9. Can you post the script used for this

    ReplyDelete
  10. Thanks, save me a lot of work

    ReplyDelete
  11. Thanks a lot! Faced the same issue with bpopup.

    ReplyDelete
  12. Thanks a LOT!!!!!!

    ReplyDelete