User (Old forums)MemberJuly 12, 2005 at 6:39 pmPost count: 23064
I have a grid 2.2 where the last column should always be autosized to fit the whole space at the right side so there should not be any empty / unused space. How is this possible? I tried to write a little procedure on my own but could not place this in the load event as it seems that the grids width is not available at this time.
Imported from legacy forums. Posted by Kai (had 3783 views)User (Old forums)MemberJuly 13, 2005 at 2:23 amPost count: 23064
You could place it in the Resize-event of the GridControl.
Imported from legacy forums. Posted by Tommy (had 297 views)User (Old forums)MemberAugust 23, 2005 at 3:40 amPost count: 23064
Could either of you guys tell me how this is actually accomplished?
Is it a case of adding up the widths of each other column and taking that off the total grid width to get the width for your “filler” column?
Will this also fix the issue when a horizontal scroll bar is activated because the size of the grid has been shrunk and you get that additional white space at the far right of the grid?
Imported from legacy forums. Posted by Dominic (had 369 views)User (Old forums)MemberAugust 24, 2005 at 2:19 amPost count: 23064
yes, that’s it. Retrieve the width of the entire grid, subtract all other columns and set the filler column to the rest width. Use also a default minimum in case your grid is too small to display all columns. Placing the function into the resize-event updates the column widths not only on initialization but also when you resize the window (as the even says…. 😉 ). You might do some fine tuning then, actually I did not get it that there is really no white space at the right, currently there are always some pixels, but I did not investigate too much on that….
Imported from legacy forums. Posted by Kai (had 389 views)User (Old forums)MemberAugust 31, 2005 at 12:25 pmPost count: 23064
In my opinion – columns should allow the user to set the width to -1 which causes that column to auto-fill the entire available grid (client) width.
Or perhaps on the grid itself, offer an “AutoSizeColumn” property – which would present the user with a list of all columns in the grid…The developer would pick from this list which column to auto-size (top entry being <none> of course)
Want to really get fancy?
How bout allowing percentages for column widths? That would you could identify specific pixel width for some columns while setting more-than-one column to auto-size according to their percentage setting.
Of course, this is just my opinion. I could be wrong 🙂
Imported from legacy forums. Posted by Curtis (had 5044 views)
- You must be logged in to reply to this topic.