バージョン

AllowColSizing プロパティ

ユーザーによる列のサイズ変更を許可するかどうかを決定する値を返すか、設定します。
シンタックス
'宣言
 
Public Property AllowColSizing As AllowColSizing
public AllowColSizing AllowColSizing {get; set;}
解説

AllowColSizing プロパティは、指定されたオーバーライドによって制御されるバンドまたはグリッドで、列のサイズ変更がどのように処理されるかを指定します。AllowColSizing プロパティは、列のサイズ変更を可能にするかどうかだけでなく、あるバンドでの列サイズの変更が、他のバンドの列幅にどのように影響するかも決定します。デフォルトでは、列は複数のバンドにわたって配置され、列幅の変更は同期化されます。つまり、1 つの列のサイズを変更すると、他の列のサイズも変更されます(複数のバンドにわたる列の配置方法を変更するには、ColSpan プロパティを使用します)。AllowColSizing を2(AllowColSizingSync)に設定すると、1 つのバンドである列のサイズを変更したときに、他のバンドの同じ位置を占めるすべての列のサイズが変更されます。When AllowColSizing を 3(AllowColSizingFree)に設定すると、指定されたバンドの列幅を、他のバンドの列幅とは無関係に変更できます。

行レイアウト機能の性質上、AllowColSizing.Synchronized はサポートされません。プロパティがこの値に設定された場合は、AllowColSizing.Free として解決されます。同様の理由で、'Synchronized' 設定はグループおよびレベル機能を使用している場合も機能しません。

使用例
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;
}
参照