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

Hiding a Layout Item, and restoring to exactly the same position

Last post 11/3/2008 10:05 AM by Philip Lee. 3 replies.
Page 1 of 1 (4 items)
Sort Posts:
Previous Next
  • 10/29/2008 1:32 PM

    Hiding a Layout Item, and restoring to exactly the same position

    I have a form where I need to hide a single element in one case, but show it in the other.  This wouldn't worry me much, but when a button is clicked I have to "re-show" the hidden item.

    When I use HideToCustomization(), and then Restore() the item it shows up at the bottom of the form, not in its original location.  This makes sense, but isn't what I need.  Right now I am trying to use Restore(base item, insert type), but I don't want to have to worry in the future about the item being moved, other items being removed, etc.


    Is there a simple way to restore to exactly the same location as before it was hidden, using only information available from that layout control item?  Ie, something like a "item.LocationInContainer" property, or set of values?

    Thanks,

    //Andrew

     

  • 10/29/2008 1:52 PM In reply to

    • Pavel
    • Top 200 Contributor
    • Joined on 7/4/2007
    • Posts 55

    Re: Hiding a Layout Item, and restoring to exactly the same position

    You should take a look at the item.Visibility property. It is demonstrated in the LayoutMainDemo in the items Visibility module.

    WPF HATER BLOG
    http://wpfhater.blogspot.com/
  • 10/29/2008 4:03 PM In reply to

    Re: Hiding a Layout Item, and restoring to exactly the same position

    That worked great.


    I looked at that property before, but for some reason I discounted it.  I guess I figured it wouldn't hide the item itself, and I would still have to use the HideToCustomization().   Also, that LayoutVisibilityConverter is nice.  I actually missed the entire layout demo somehow, probalby because I was digging around in XtraEditors instead.

    Thanks!

  • 11/3/2008 10:05 AM In reply to

    Re: Hiding a Layout Item, and restoring to exactly the same position

     What's annoying though, is that hiding an item using Visiblity leaves a 1 pixel rectangle.

    Try the simple items visibility demo and toggle 'show picture 1' on and off.  You'll see the left hand edge of the picture jiggle back and forth.  This is an annoyance in a real UI where several controls are dynamically shown since each hidden control takes up 1 pixel.

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