How do I get a grid to auto size?
Want it to be as small as possible but still show all the columns.
Also if I add a column i want it to resize.
On a similar note whenever i try to open a xaml file that contains a infragistics control, in blend i get an exception. Do i need to load something in blend to prevent this?
thanks
Hi,
So i'm not completely sure what you're looking for.
If you're looking for all columns to always be visible, no matter what size the grid is, then you should set the ColumnWidth property to "*";
<ig:XamWebGrid ColumnWidth="*"/>
If you're looking for the grid to size dynamically, based on the size of it's content, then you shouldn't set a width on the grid, and you need to put it in a panel, that would give it infinite width, such as StackPanel with it's orientation set to Horizontal. (Note this will disable star sizing, and horizontal cell virtualization)
-SteveZ
I want it to be as small as possible but still show all the columns.
So if i have a table that has 3 columns:
ColumnA,ColumnB,Column C
I want the grid to only be as wide as those columns and no wider. I am getting a large space to right of the last column.
Also if I dynamically add another column i want it to dynamically get bigger.
Putting it into a stack panel with orientation horizontal seems to do the trick.
Only now i have a different issue. When I add columns and it get too big, it just gets cut off to the right, with out the scroll bar popping up.
How do i get the scroll bar to show up once it get too big?