Version

MaxValue Property

Specifies the maximum value that can be entered in the cell. Default value is null meaning no maximum constraint. The object assigned to this property should be the same type as the column's DataType or compatible otherwise it won't be honored.
Syntax
'Declaration
 
Public Property MaxValue As Object
public object MaxValue {get; set;}
Example
The following code shows how to set min and max constraints on a column. When the user attempts to exit the edit mode (for example by leaving the cell) after entering a value that doesn't satisfy MinValue or MaxValue constraint, the grid fires CellDataError event and shows an error message. You can show you own message by hooking into CellDataError. MinValue and MaxValue are object types, so you can assign a min value and max value for different column types.

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

  Private Sub Button19_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button19.Click

      Dim dateColumn As UltraGridColumn = Me.ultraGrid1.DisplayLayout.Bands(1).Columns("OrderDate")
      Dim numericColumn As UltraGridColumn = Me.ultraGrid1.DisplayLayout.Bands(2).Columns("Unit Price")

      ' Put min and max constraints on a date column.
      dateColumn.MinValue = New DateTime(1990, 1, 1)
      dateColumn.MaxValue = New DateTime(2010, 12, 31)

      ' Put a min value constraint on a numeric column.
      numericColumn.MinValue = 0.0

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

private void button19_Click(object sender, System.EventArgs e)
{

	UltraGridColumn dateColumn = this.ultraGrid1.DisplayLayout.Bands[1].Columns["OrderDate"];
	UltraGridColumn numericColumn = this.ultraGrid1.DisplayLayout.Bands[2].Columns["Unit Price"];

	// Put min and max constraints on a date column.
	dateColumn.MinValue = new DateTime( 1990, 1, 1 );
	dateColumn.MaxValue = new DateTime( 2010, 12, 31 );

	// Put a min value constraint on a numeric column.
	numericColumn.MinValue = 0.0;

}
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