Hi all,
I have the webgrid(ColumnWidth="*") placed inside a <Grid> , which is placed in a Border(HorizontalAlignment="Stretch" VerticalAlignment="Top"), that is presented as a page inside <navigation:Frame>
Now, with this situation, everything is perfect, the grid column widths are resized to fit the page width;
However, if I add a scrollview control that contains the <navigation:Frame>, the column widths are not changed at all! Even if I hardcode the ColumnWidth property of the grid;
How can I solve this?
Hi,
Star column widths will only act like Auto sizing, when the xamWebGrid is given infinite width, as star sizing requires a fixed sized width in order to determine how much additional space is left. The Grid panel behaves the exact same way.
If you wan't the column widths to adhere to star sizing, then you need to have a width set on the xamWebGrid, or it's parent container, in this case the Grid panel. Or you can set the HorizontalScrollbarVisibility of the ScrollViewer to Disabled, which should give the xamWebGrid a width.
Note, placing the xamWebGrid in containers that give it infinite width and height could cause performance issues, as virtualization will no longer be applied. So, if you have a grid with a lot of rows or columns, then you should avoid this.
Hope this helps,
-SteveZ
Hi Stephen,
First of all, excellent explanation! Thanks a lot;
I've done what you said, and it placed the grid as I wanted in the set width of the Grid containing it;
(I already had the HorizontalScrollbarVisibility set to Disabled).
So, just some short qustions now:
- this way I have the virtualization applied, right?
- is the best way (for my needs) to modify the Grid width when the window is resized?