Version

ResetCachedValues Method (UltraDataBand)

Clears cell values of rows associated with this band. This will cause the UltraDataSource component to fire CellDataRequested event for cells next time the values for those cells are needed.
Syntax
'Declaration
 
Public Sub ResetCachedValues() 
public void ResetCachedValues()
Remarks

You can also use the UltraDataRowsCollection's UltraDataRowsCollection.ResetCachedValues method to clear the cached cell values of a particular row collection. UltraDataRow also exposes UltraDataRow.ResetCachedValues method.

Example
Following code demonstrates methods for clearing cached values exposed off various objects.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinDataSource


    Private Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim ds As UltraDataSource = New UltraDataSource()
        ds.Band.Columns.Add("Col1", GetType(String))
        ds.Rows.Add()

        ' Calling ResetCachedValues on the UltraDataSource will clear cached
        ' cell values in all rows in all bands.
        ds.Rows(0)("Col1") = "Value"
        Debug.WriteLine("Before reset cell value = " & ds.Rows(0)("Col1"))
        ds.ResetCachedValues()
        Debug.WriteLine("After reset cell value = " & ds.Rows(0)("Col1"))

        ' Calling ResetCachedValues on a band will clear the cached cell values
        ' in all rows associated with the band.
        ds.Rows(0)("Col1") = "Value"
        Debug.WriteLine("Before reset cell value = " & ds.Rows(0)("Col1"))
        ds.Band.ResetCachedValues()
        Debug.WriteLine("After reset cell value = " & ds.Rows(0)("Col1"))

        ' Calling ResetCachedValues on a row collection will clear the cached 
        ' cell values in all rows in the row collection.
        ds.Rows(0)("Col1") = "Value"
        Debug.WriteLine("Before reset cell value = " & ds.Rows(0)("Col1"))
        ds.Rows.ResetCachedValues()
        Debug.WriteLine("After reset cell value = " & ds.Rows(0)("Col1"))

        ' Cached cell values associated with a column can be cleared across
        ' all rows using ResetCachedValues method off the UltraDataColumn
        ' object.
        ds.Rows(0)("Col1") = "Value"
        Debug.WriteLine("Before reset cell value = " & ds.Rows(0)("Col1"))
        ds.Band.Columns("Col1").ResetCachedValues()
        Debug.WriteLine("After reset cell value = " & ds.Rows(0)("Col1"))

        ' Calling ResetCachedValues on a row will clear the cached cell values
        ' in that row.
        ds.Rows(0)("Col1") = "Value"
        Debug.WriteLine("Before reset cell value = " & ds.Rows(0)("Col1"))
        ds.Rows(0).ResetCachedValues()
        Debug.WriteLine("After reset cell value = " & ds.Rows(0)("Col1"))

        ' Cached value can be cleared on a single cell using the 
        ' ResetCachedValue method of the row and passing in the column.
        ds.Rows(0)("Col1") = "Value"
        Debug.WriteLine("Before reset cell value = " & ds.Rows(0)("Col1"))
        ds.Rows(0).ResetCachedValue("Col1")
        Debug.WriteLine("After reset cell value = " & ds.Rows(0)("Col1"))
    End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinDataSource;
using System.Diagnostics;


		private void button1_Click(object sender, System.EventArgs e)
		{
			UltraDataSource ds = new UltraDataSource( );
			ds.Band.Columns.Add( "Col1", typeof( string ) );
			ds.Rows.Add( );

			// Calling ResetCachedValues on the UltraDataSource will clear cached
			// cell values in all rows in all bands.
			ds.Rows[0]["Col1"] = "Value";
			Debug.WriteLine( "Before reset cell value = " + ds.Rows[0]["Col1"] );			
			ds.ResetCachedValues( );
			Debug.WriteLine( "After reset cell value = " + ds.Rows[0]["Col1"] );

			// Calling ResetCachedValues on a band will clear the cached cell values
			// in all rows associated with the band.
			ds.Rows[0]["Col1"] = "Value";
			Debug.WriteLine( "Before reset cell value = " + ds.Rows[0]["Col1"] );			
			ds.Band.ResetCachedValues( );
			Debug.WriteLine( "After reset cell value = " + ds.Rows[0]["Col1"] );

			// Calling ResetCachedValues on a row collection will clear the cached 
			// cell values in all rows in the row collection.
			ds.Rows[0]["Col1"] = "Value";
			Debug.WriteLine( "Before reset cell value = " + ds.Rows[0]["Col1"] );			
			ds.Rows.ResetCachedValues( );
			Debug.WriteLine( "After reset cell value = " + ds.Rows[0]["Col1"] );

			// Cached cell values associated with a column can be cleared across
			// all rows using ResetCachedValues method off the UltraDataColumn
			// object.
			ds.Rows[0]["Col1"] = "Value";
			Debug.WriteLine( "Before reset cell value = " + ds.Rows[0]["Col1"] );
			ds.Band.Columns["Col1"].ResetCachedValues( );
			Debug.WriteLine( "After reset cell value = " + ds.Rows[0]["Col1"] );

			// Calling ResetCachedValues on a row will clear the cached cell values
			// in that row.
			ds.Rows[0]["Col1"] = "Value";
			Debug.WriteLine( "Before reset cell value = " + ds.Rows[0]["Col1"] );
			ds.Rows[0].ResetCachedValues( );
			Debug.WriteLine( "After reset cell value = " + ds.Rows[0]["Col1"] );

			// Cached value can be cleared on a single cell using the 
			// ResetCachedValue method of the row and passing in the column.
			ds.Rows[0]["Col1"] = "Value";
			Debug.WriteLine( "Before reset cell value = " + ds.Rows[0]["Col1"] );
			ds.Rows[0].ResetCachedValue("Col1");
			Debug.WriteLine( "After reset cell value = " + ds.Rows[0]["Col1"] );
		}
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