Version

Value Property (UltraGridCell)

Returns or sets the underlying data value of a cell. This property is not available at design-time.
Syntax
'Declaration
 
Public Overridable Property Value As Object
public virtual object Value {get; set;}
Remarks

Use this property to retrieve or modify a cell's value. When the value of a cell is changed, the BeforeCellUpdate and the AfterCellUpdate events are generated and the cell's DataChanged property is set to True. Note that the cell's new value is not necessarily committed to the data source when this property is set, however, since various factors such as the type of record locking employed by the data source, as well as the value of the UpdateMode property, can affect when the actual update occurs.

The OriginalValue property of the cell can be used to determine the cell's value before it was changed.

The GetText method can be invoked to return the formatted value of a cell.

Example
Following code shows how to get the cell's value in a few different ways.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid
Imports System.Diagnostics

   Private Sub Button63_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button63.Click

       Dim row As UltraGridRow = Me.UltraGrid1.Rows(1)
       Dim column As UltraGridColumn = Me.UltraGrid1.DisplayLayout.Bands(0).Columns(1)

       ' UltraGridCell.Value property returns the same value as returned by GetCellValue below.
       Dim cellVal1 As Object = row.Cells(column).Value

       ' UltraGridRow.GetCellValue method returns the cell's value.
       Dim cellVal2 As Object = row.GetCellValue(column)

       ' UltraGridCell.Text property returns the same text as returned by GetCellText below 
       ' except when the cell is in edit mode in which case the UltraGridCell.Text returns the
       ' current text that the user has entered in the cell while UltraGridColumn.GetCellText 
       ' returns the cell's value that's in the bound list converted to text. NOTE: The same
       ' doesn't hold true for UltraGridCell.Value and UltraGridColumn.GetCellValue where both
       ' return the values from the bound list regardless of whether the cell is in edit mode and
       ' the user has modified the cell's value.
       Dim cellText1 As String = row.Cells(column).Text

       ' UltraGridRow.GetCellText method returns the cell's value converted to text.
       Dim cellText2 As String = row.GetCellText(column)

       Debug.WriteLine("UltraGridCell.Value		= " & cellVal1.ToString())
       Debug.WriteLine("UltraGridRow.GetCellValue	= " & cellVal2.ToString())
       Debug.WriteLine("UltraGridCell.Text         = " & cellText1)
       Debug.WriteLine("UltraGridRow.GetCellText	= " & cellText2)

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

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

	UltraGridRow row = this.ultraGrid1.Rows[1];
	UltraGridColumn column = this.ultraGrid1.DisplayLayout.Bands[0].Columns[1];

	// UltraGridCell.Value property returns the same value as returned by GetCellValue below.
	object cellVal1 = row.Cells[column].Value;

	// UltraGridRow.GetCellValue method returns the cell's value.
	object cellVal2 = row.GetCellValue( column );

	// UltraGridCell.Text property returns the same text as returned by GetCellText below 
	// except when the cell is in edit mode in which case the UltraGridCell.Text returns the
	// current text that the user has entered in the cell while UltraGridColumn.GetCellText 
	// returns the cell's value that's in the bound list converted to text. NOTE: The same
	// doesn't hold true for UltraGridCell.Value and UltraGridColumn.GetCellValue where both
	// return the values from the bound list regardless of whether the cell is in edit mode and
	// the user has modified the cell's value.
	string cellText1 = row.Cells[column].Text;

	// UltraGridRow.GetCellText method returns the cell's value converted to text.
	string cellText2 = row.GetCellText( column );
	
	Debug.WriteLine( "UltraGridCell.Value		= " + cellVal1.ToString( ) );
	Debug.WriteLine( "UltraGridRow.GetCellValue	= " + cellVal2.ToString( ) );
	Debug.WriteLine( "UltraGridCell.Text		= " + cellText1 );
	Debug.WriteLine( "UltraGridRow.GetCellText	= " + cellText2 );

}
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