Imports Infragistics.Shared Imports Infragistics.Win Imports Infragistics.Win.UltraWinGrid Imports System.Diagnostics Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load ' Use the same data source and data member to access the currency manager in the ' button's click handler below. Me.ultraGrid1.SetDataBinding(Me.DataSet11, "Customers") End Sub Private Sub Button87_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button87.Click ' Get the currency manager. Dim cm As CurrencyManager = CType(Me.BindingContext(Me.DataSet11, "Customers"), CurrencyManager) Dim row As UltraGridRow = Me.UltraGrid1.Rows(0) Dim listObject1 As Object = row.ListObject Dim listObject2 As Object = cm.List(row.ListIndex) ' Write out the type names. If we are bound to a data set like in this case, these ' objects should be DataRowView objects. Debug.WriteLine("listObject1 type = " & listObject1.GetType().Name) Debug.WriteLine("listObject2 type = " & listObject2.GetType().Name) ' Following should write out true. Debug.WriteLine("Are listObject1 and listObject2 the same: " & (listObject1 Is listObject2)) End Sub
using Infragistics.Shared; using Infragistics.Win; using Infragistics.Win.UltraWinGrid; using System.Diagnostics; private void Form1_Load(object sender, System.EventArgs e) { // Use the same data source and data member to access the currency manager in the // button's click handler below. this.ultraGrid1.SetDataBinding( this.dataSet11, "Customers" ); } private void button87_Click(object sender, System.EventArgs e) { // Get the currency manager. CurrencyManager cm = (CurrencyManager)this.BindingContext[this.dataSet11, "Customers"]; UltraGridRow row = this.ultraGrid1.Rows[0]; object listObject1 = row.ListObject; object listObject2 = cm.List[ row.ListIndex ]; // Write out the type names. If we are bound to a data set like in this case, these // objects should be DataRowView objects. Debug.WriteLine( "listObject1 type = " + listObject1.GetType( ).Name ); Debug.WriteLine( "listObject2 type = " + listObject2.GetType( ).Name ); // Following should write out true. Debug.WriteLine( "Are listObject1 and listObject2 the same: " + ( listObject1 == listObject2 ) ); }