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
75
CardView: can UltraGrid scrolls Vertically
posted

We're using the Grid with CardView=true;

           UltraGridBand band = ultraGridResults.DisplayLayout.Bands[0];
            band.UseRowLayout = true;
            band.CardView = true;
            band.CardSettings.Style = CardStyle.Compressed;
          //  band.CardSettings.CardScrollbars = CardScrollbars.None;//???

if GridRows do not fit into grid verically(sum of Row's heights > Grid.Height), grid automatically expands and scrolls Horizontally. Can grid be forced to expand vertically to prevent appearance of multiple columns on screen?

Thank You,

Mike

  • 469350
    Suggested Answer
    Offline posted

    Hi Mike,

    No, there's currently no way to do this with CardView. If you want vertical scrolling instead of Horizontal, maybe you would be better off just using RowLayouts without CardView.

    This would mean losing the ability to Compress a row, but it might work out better for you.

    • 25
      posted in reply to Mike Saltzman

      But  http://help.infragistics.com/Help/NetAdvantage/WinForms/2009.1/CLR2.0/HTML/WinGrid_Whats_New_2005_1.html

      says it's possible:

      "The WinGrid now supports vertical scrolling of the card view area. Previously, when the vertical area used to display cards was less than the height of the cards, the height of the cards was reduced, causing the bottom of the card to disappear. Now, a vertical scrollbar is displayed on the right-hand side of the card area (CardAreaUIElement). This provides the ability to scroll up or down and bring any part of the card into view.  The following screenshot shows a multi-band grid with a card view area that is shorter than the cards it contains (notice the presence of a vertical scrollbar (inner) which appears automatically when required).  When the height of the CardView area (CardAreaUIElement) is less than the height of any card that needs to be displayed, we now display a vertical scrollbar so that any part of the card can be brought into view. The vertical scrollbar appears and disappears as needed. The SmallChange value for the vertical scrollbar is set so that it takes approximately 10 clicks to scroll the entire range. The LargeChange value is set to five times that amount, so that only two clicks on the scroll track are required to scroll the entire range.  The CardAreaUIElement now supports mouse wheeling and mouse panning for both horizontal and vertical scrolling. When the middle mouse button is clicked over the card area, the appropriate panning image is displayed depending on whether horizontal and/or vertical scrolling is possible.  When the mouse wheel is moved while the cursor is positioned over the horizontal scrollbar, the card area is scrolled horizontally.  When the cursor is positioned anywhere else, it is scrolled vertically (provided that scrolling is possible)."

       

      Why it is not possible?

      • 45049
        posted in reply to Etienne

        The article you reference describes what happens when an indvidual card would be too tall to display all of its content.  A vertical scrollbar appears in this case, allowing you to scroll to view the rest of the card.  This applies solely to card view.

        The functionality discussed in this thread was having cards stack upon each other in a vertical fashion, rather than a horizontal fashion.  As Mike mentioned, this is currently not possible with card view, and using row layouts is the way to accomplish a similar result.  When row layouts are used, the grid's veritcal scrolling is entirely row-based - so, if you've defined a row layout that is taller than the grid can display, you won't be able to view the bottom part of hthat layout.

      • 70
        posted in reply to Mike Saltzman

        Hello,

        This is great advice. I tried something similar because I wanted to get a side view where the labels were on the left and the value on the right, but still keep the ability to have child bands.  This works but when I have a table with 1 row with 20 columns, the verticle scrollbar never enables.  The first row is too big to be on one screen.  I tried setting the scrollbars to Auto, and Both.  I also noticed that some of the columns get squished together in one row so row two ends up behind row 1.  Any ideas?  My psuedo code is below.

         m_ultraGrid.DisplayLayout.Bands[0].UseRowLayout = true;

        m_ultraGrid.DisplayLayout.Bands[0].RowLayoutLabelPosition =

        LabelPosition.Left;

        m_ultraGrid.DisplayLayout.Bands[0].Layout.Override.RowSelectorWidth = 20;

        m_ultraGrid.DataSource = m_ultraGridSourceSet;

         

        int i = 0;

         

         

        foreach (UltraGridColumn uc in  m_ultraGrid.DisplayLayout.Bands[0].Columns)

        {

        uc.RowLayoutColumnInfo.OriginX = 0;

        uc.RowLayoutColumnInfo.OriginY = i;

        uc.RowLayoutColumnInfo.LabelPosition =

        LabelPosition.Left;

         

        }

         

        • 469350
          Offline posted in reply to Tim

          h2razik said:
          In your expert opinion is there a way to do some coding to create custom row scrolling functionality?

          You could try to make the grid large enough to fit the entire row and then place the grid inside a scrollable container so that the user can scroll the whole grid. But there's no easy way to determine the height you will need.

          • 70
            posted in reply to Mike Saltzman

            Thank you for the prompt answer. We see this is a serious limitation as any time you have any row that is too tall for a single screen the data is not accessible.   Using a Card View does allow us to get the view we need, but it does not allow you to have child bands.  I did notice that the card view allows scrolling. In your expert opinion is there a way to do some coding to create custom row scrolling functionality?  If not we'll resort to modifying the data sets to pivot and unpivot the data, but wanted to avoid this operation if possibe.

            • 469350
              Offline posted in reply to Tim

              There's no way to do that. The grid's vertical scrolling is row-based. It will always scroll such that a row is flush against the top of the grid. So if you have a single row that is taller than the grid, there is no way to see the bottom of that row.

              • 70
                posted in reply to Tim

                By the way, I figured out the hidden row problem.  I needed to set SpanX=2 and SpanY=1, but the scrolling is still an issue.