Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
315
Hiding the header in UltraListView
posted

Hello,

Simple as it is, I can't find how to hide the header in this UltraListView, which is the right box in this work-in-progress screenshot:

http://www.softwaremotif.com/technical/images/MyFindings.jpg

I have suppressed all header properties I can find as well as made the header 0,0 but I still have the grey header container at the top.

Any comments much appreciated.  Thank you!

Parents
No Data
Reply
  • 209
    Suggested Answer
    Offline posted
    1. Define a class that implements IUIElementCreationFilter:

      class NoHeaderCreationFilter : IUIElementCreationFilter
      {
          public void AfterCreateChildElements(UIElement parent)
          {
              if (parent is UltraListViewUIElement && (parent.Control as UltraListView).View == UltraListViewStyle.Details)
              {
                  UIElement header = parent.ChildElements[0];
                  UIElement list = parent.ChildElements[1];

                  Rectangle rc = Rectangle.Union(header.Rect, list.Rect);
                  list.Rect = rc;

                  rc.Height = 0;
                  header.Rect = rc;
              }
          }

          public bool BeforeCreateChildElements(UIElement parent)
          {
              return false;
          }
      }


    2. Set your UltraListView to use this class:

      myListView..CreationFilter = new NoHeaderCreationFilter();
Children
No Data