Version

AllowColSizing Property

Returns or sets a value that determines whether the user is allowed to size columns.
Syntax
'Declaration
 
Public Property AllowColSizing As AllowColSizing
public AllowColSizing AllowColSizing {get; set;}
Remarks

The AllowColSizing property specifies how column resizing will be handled in the band or the grid controlled by the specified override. The AllowColSizing property determines not only whether columns can be resized, but how resizing columns within one band will affect the width of columns in other bands. By default, columns are aligned across multiple bands and the change in their widths is synchronized; when you resize one column, the others resize also. (You can change how columns align across bands by using the ColSpan property.) When AllowColSizing is set to 2 (AllowColSizingSync) a column resized in one band will resize all columns in other bands that occupy the same position. When AllowColSizing is set to 3 (AllowColSizingFree) the width of columns in the specified band can be changed independently of the widths of columns in other bands.

Due to the nature of Row-Layout functionality, AllowColSizing.Synchronized is not supported. If the property is set to that value, then it will resolve as AllowColSizing.Free. The 'Synchronized' setting also does not work when using the Groups and Levels functionality, for similar reasons.

Example
Following code sets some of the properties available for controlling column sizing.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid

  Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button1.Click
      ' By default, the widths of the columns in different bands are synchronized.
      ' You can set the AllowColSizing to Free to prevent that so you can have
      ' different widths for columns in different bands.
      Me.ultraGrid1.DisplayLayout.Override.AllowColSizing = AllowColSizing.Free

      ' ColumnSizingArea specifies the area used for resizing the columns.
      Me.ultraGrid1.DisplayLayout.Override.ColumnSizingArea = ColumnSizingArea.EntireColumn

      ' DefaultColWidth indicates the default width that the UltraGrid will assign
      ' to each column in the UltraGrid when none is explicitly specified for that
      ' column.
      Me.ultraGrid1.DisplayLayout.Override.DefaultColWidth = 100

      ' You can override that grid-wide setting for a particular band by setting it
      ' on the override of that band.
      Me.ultraGrid1.DisplayLayout.Bands(0).Override.AllowColSizing = AllowColSizing.None
      Me.ultraGrid1.DisplayLayout.Bands(0).Override.DefaultColWidth = 120

      ' You can also set widths of individual columns.
      Me.ultraGrid1.DisplayLayout.Bands(0).Columns(0).Width = 200

      ' You can also control the column sizing aspect for a particular column.
      ' MinWidth and MaxWidth properties off the UltraGridColumn limit how much the
      ' user can resize the column. Following code won't allow the user to make the
      ' column smaller than 60 pixels and wider than 200 pixels.
      Me.ultraGrid1.DisplayLayout.Bands(0).Columns(0).MinWidth = 60
      Me.ultraGrid1.DisplayLayout.Bands(0).Columns(0).MinWidth = 200
  End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

private void button1_Click(object sender, System.EventArgs e)
{
	// By default, the widths of the columns in different bands are synchronized.
	// You can set the AllowColSizing to Free to prevent that so you can have
	// different widths for columns in different bands.
	this.ultraGrid1.DisplayLayout.Override.AllowColSizing = AllowColSizing.Free;

	// ColumnSizingArea specifies the area used for resizing the columns.
	this.ultraGrid1.DisplayLayout.Override.ColumnSizingArea = ColumnSizingArea.EntireColumn;

	// DefaultColWidth indicates the default width that the UltraGrid will assign
	// to each column in the UltraGrid when none is explicitly specified for that
	// column.
	this.ultraGrid1.DisplayLayout.Override.DefaultColWidth = 100;

	// You can override that grid-wide setting for a particular band by setting it
	// on the override of that band.
	this.ultraGrid1.DisplayLayout.Bands[0].Override.AllowColSizing = AllowColSizing.None;
	this.ultraGrid1.DisplayLayout.Bands[0].Override.DefaultColWidth = 120;

	// You can also set widths of individual columns.
	this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].Width = 200;

	// You can also control the column sizing aspect for a particular column.
	// MinWidth and MaxWidth properties off the UltraGridColumn limit how much the
	// user can resize the column. Following code won't allow the user to make the
	// column smaller than 60 pixels and wider than 200 pixels.
	this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].MinWidth = 60;
	this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].MinWidth = 200;
}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also