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
1060
WebGrid Column size - mix of fixed and %age?
posted

Hi - I have a grid set to fill 100% width on my page.  I would like to fix *some* of the columns to a certain size (as the cell contents will always be a certain size - e.g. a product code), but have most of the other cells as a %age so that they can grow and shrink based on the width of the window.

Is this possible with UltrawebGrid?

Thanks in advance!

Jonathan

  • 220
    posted

    Did you find a solution to this problem?

     

    In my case, I'm not so much worried about the fixed columns, but for my requirements, the grid must function as follows

    • the grid is 100% wide. This works with myGrid.Width = new Unit(100, Percentage);
    • The columns span the entire width of the visible space. I can't find a way to do this. setting 100% on columns doesn't work either.
    • When the page size decreases, the width of the grid also decreases, but the columns stay the same size. Again, I can't find a way to make the columns shrink when this occurs.

     

    Essentially. I only want the grid to show vertical scrollbars, unless the user has widened the column width of a column such that all the grid needs the scrollbars. Likewise, the user should not have to stretch the columns to fit within the stretched width of the grid when the page loads. Similarly, if the user reduces the size of the window, the grid (set with width = 100%) will shrink indefinitely. However the columns will stay the same. This is also unsettling because I need the columns to shrink down as far as possible without cutting off text.

     

    How can i satisfy these simple (and standard) requirements? I can do without the user being able to resize the columns. The only reason I'm using that feature now is because automatic column sizing is some form of magic trick.