Version

DataBind Method (UltraGridBase)

Rebinds to the data source, causing InitializeLayout to be fires again. Note that setting the DataSource property binds to the data source and loads the data. This method is for forcing the UltraGrid to reload the data.
Syntax
'Declaration
 
Public Sub DataBind() 
public void DataBind()
Remarks

DataBind method reloads the data. Reloading the data source will cause the InitializeLayout event to be fired. To bind to a data source, simply setting the DataSource property is sufficient. This method is used for forcing the UltraGrid to reload the data.

Note: Setting the DataSource property and calling the DataBind after it will cause the UltraGrid to load the data twice, and cause the InitializeLayout event to be fired twice as well.

Example
Following code binds an UltraGrid to a data source in Form's Load event and calls DataBind on a button's handler to force the UltraGrid to reload the data source.

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

  Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load

      Me.ultraGrid1.SetDataBinding(Me.DataSet11, "Customers")

  End Sub

  Private Sub Button78_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button78.Click

      ' When DataBind is called, the UltraGrid will reload the bands, columns and the rows
      ' from the data source. This can be used to force the grid to rebind to the data source.
      Me.UltraGrid1.DataBind()

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

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

	this.ultraGrid1.SetDataBinding( this.dataSet11, "Customers" );

}

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

	// When DataBind is called, the UltraGrid will reload the bands, columns and the rows
	// from the data source. This can be used to force the grid to rebind to the data source.
	this.ultraGrid1.DataBind( );

}
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