LockedWidth Property

Determines if the width of the column can be changed by the user.
Public Property LockedWidth As Boolean
public bool LockedWidth {get; set;}

You can use the LockedWidth property to disable user resizing of a column. Columns can still be resized through code even when this property is True. Note that setting this property to True may disable the resizing of other columns than the one specified. If the specified column is synchronized with a column in a child band, that column will also become locked. Similarly, setting the LockedWidth property to True for certain columns in a group may result in the user being unable to resize the group, depending on the position of the locked columns.

This property is ignored for chaptered columns; that is, columns whose DataType property is set to 136 (DataTypeChapter).

Following code sets the LockedWidth property of CustomerID column to true to prevent the user from resizing that column.

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

  Private Sub Button119_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button119.Click

      Dim column As UltraGridColumn = Me.UltraGrid1.DisplayLayout.Bands(0).Columns("CustomerID")

      ' Set LockedWidth to true to prevent the user from resizing the column.
      column.LockedWidth = True

  End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

private void button119_Click(object sender, System.EventArgs e)

	UltraGridColumn column = this.ultraGrid1.DisplayLayout.Bands[0].Columns["CustomerID"];

	// Set LockedWidth to true to prevent the user from resizing the column.
	column.LockedWidth = true;


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