Version

We recommend that you use the xamDataGrid control instead of the xamGrid control. The xamGrid is being planned for retirement over the next few years and will not receive any new features. We will continue to provide support and critical bug fixes for the xamGrid during this time. For help or questions on migrating your codebase to the xamDataGrid, please contact support.

Column Resizing

The xamGrid™ control allows your end users to resize their columns by dragging the right hand side column separator to the left or right. Your end users can also resize columns by double clicking on the column separator. Multi-column resizing is also supported.

Column resizing can be configured to behave in one of the following ways:

  • A resize indicator displays where the column will be moved to. If the other columns are star sized, then the indicator may not be 100% accurate.

  • The column is resized as soon as your end user starts dragging the resizing indicator

By default, column resizing is enabled and set to Immediate on the xamGrid control. However, you can override this by setting the ColumnResizingSettings object’s AllowColumResizing property to one of the following ColumnResizingType enumeration values:

  • Indicator – This value enables column resizing and a resize indicator displays where the column will be moved to.

  • Immediate – This value enables column resizing and resizes the column as soon as your end user starts dragging the resizing indicator.

  • Disabled – This value disables column resizing.

The following code demonstrates how to enable column resizing.

In XAML:

<ig:XamGrid x:Name="MyGrid">
   <ig:XamGrid.ColumnResizingSettings>
      <ig:ColumnResizingSettings AllowColumnResizing="Indicator"/>
   </ig:XamGrid.ColumnResizingSettings>
</ig:XamGrid>

In Visual Basic:

Imports Infragistics.Controls.Grids
...
Me.MyGrid.ColumnResizingSettings.AllowColumnResizing = ColumnResizingType.Indicator

In C#:

using Infragistics.Controls.Grids;
...
this.MyGrid.ColumnResizingSettings.AllowColumnResizing = ColumnResizingType.Indicator;
Column Resizing