in
Forums
Blogs
Files
Devexpress.Com
ClientCenter
Support Center
DevExpress Channel

PopupContainerEdit and PopupContainerControl sizing

Last post 8/14/2008 9:21 AM by Warren Midgley. 3 replies.
Page 1 of 1 (4 items)
Sort Posts:
Previous Next
  • 6/18/2008 2:17 PM

    PopupContainerEdit and PopupContainerControl sizing

    I have a PopupContainerEdit and PopupContainerControl on a form working together.  I would like to have the PopupContainerControl always be the same width as the PopupContainerEdit.  If i set the width of the PopupContainerControl on the Popup event of the PopupContainerEdit it appears the contents of the PopupContainerControl are appropriately resized, however the PopupContainerControl itself is not resized correctly along with its contents.

    I have attached a couple of screen capture images that show the problem i am running into.
    Picture1 shows the default starting size of the controls
    Picture2 shows the popup after the width of the form has been increased

    As you can see in Picture2 the contents appear to be resizing correctly because the scrollbar of the CheckedListBox and the OK button have been moved out of view.

    Thanks for any help you can provide.

  • 8/14/2008 8:10 AM In reply to

    Re: PopupContainerEdit and PopupContainerControl sizing

    I think I've hit the same problem. Did you manage to find a solution or workaround?

    -Regards

       Scott

  • 8/14/2008 8:42 AM In reply to

    Re: PopupContainerEdit and PopupContainerControl sizing

    The best workaround I could find is this.  On the PopupContainerControl set AutoSize to True and AutoSizeMode to GrowAndShrink.  Then in the ClientSizeChanged event of the top level container control (could be a Panel or the Form itself, doesn't matter) redefine the PopupMinSize of the PopupContainerEdit as follows:

    Size popupSize = new Size(popupEditControl.Width, popupContainerControl.Height);
    popupEditControl.Properties.PopupFormMinSize = popupSize;

    The only problem I've got with this solution is that once the form is increased in size the popup resizes correctly, but when the form size is then decreased the popup container stays the same size as before.  We've left this implementation in place because at least it will continue to show the entire contents of the popup whereas before it was cutting off significant portions of the contents of the popup container.

    Hope this is useful to you in some way.

    Regards.

  • 8/14/2008 9:21 AM In reply to

    Re: PopupContainerEdit and PopupContainerControl sizing

    Thankyou very much. I will experiment with that. I have just been trying different things and have found that if I add a handler to QueryPopup, I can change the width and height of the PopupContainerControl there. Setting the width anywhere else doesn't seem to have any effect.

    But, this isn't fully working for me as the size of the popup needs to varies depending upon what's displayed in it. The popup is showing a calendar control, and the calendar seems to be a different width on different operating systems. I'm trying to set the popup's width to fit the calendar control. This is tricky because the calendar control seems to report it's width incorrectly the first time the QueryPopup event fires, only after the calendar has rendered itself once does it seems to know what its size is. This means, currently my popup is completely the wrong size on the first time the user pops it up, but its the right size the second time! Grrr. Maybe your solution will be better.

    Thanks for your reply.

     

Page 1 of 1 (4 items)
Copyright © 1998-2008 Developer Express Inc.
ALL RIGHTS RESERVED