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!

  • 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();
  • 740
    Offline posted

    I ran into same problem and hopefully it will be a new feature in one of the next releases.

    In the meantime i followed this workaround to hide the header with this code:

     

            lstInfo.View = UltraWinListView.UltraListViewStyle.Details

            With lstInfo.ViewSettingsDetails

                .ColumnHeaderStyle = HeaderStyle.Standard
                .ColumnHeaderBorderStyle = UIElementBorderStyle.None
                .ColumnHeaderAppearance.BackColor = Color.Transparent
                .AllowColumnSizing = False
                .AllowColumnSorting = False

            End With

    Obviously it still takes up de used space.
    Perhaps it's helpfull for others.
    Regards,
    Jacob Iedema

     

  • 69832
    Offline posted

    Assuming you are using the 'Details' setting of the View property, you cannot hide the header. Going by the screenshot it would appear that you only have one column, so you should use set the View property to 'List', and if you want only one column of items, set the UltraListView.ViewSettingsList.MultiColumn property to false.