Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #13157 |

    Is there a way to get a grid to automatically resize its columns when the grid is resized?

    In our application, the user can resize the form, which accordingly resizes the grid. Ideally, the grid should resize its columns to make use of the new space or fit in the less space. The columns should also respect the min and max width for the columns.

    Also is there a way to save the current state of the grid in terms of order of the columns, grouping, column sizes, sorting, …etc?

    Thanks,
    Victor.

    Imported from legacy forums. Posted by vboctor (had 2116 views)

    User (Old forums)
    Member
    Post count: 23064

    To save the state of the grid (order, size and sorting of columns, but not grouping): see <a href=”http://www.xceedsoft.com/Forums/ShowPost.aspx?PostID=1723″>http://www.xceedsoft.com/Forums/ShowPost.aspx?PostID=1723</a&gt;.

    For resizing columns: catch the Resize-event of the grid-control, and set the Width-property of your columns manually, in the eventhandler. If you really need this, you’ll also have to either disable manual resizing of the columns by the user, or deal with that too.
    And how should they resize? Proportionally (each column = x% of total width)? A different approach is to let all columns have a static width, except 1 column whose width will be gridWidth – sumOfWidthOfOtherColumns.

    Imported from legacy forums. Posted by Tommy (had 3119 views)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.