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
415
Auto Sizing a grid
posted

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 

Parents
  • 40030
    Offline posted

    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

Reply Children