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
' Assign the UpdateMode to OnRowChange to test code below. If it's left
' to its default value of OnRowChangeOrLostFocus, then clicking on the button will cause the
' UltraGrid to lose focus and update the row before the button handler gets executed and we
' won't be able to illustrate the DataChanged and Update methods below.
Me.ultraGrid1.UpdateMode = UpdateMode.OnRowChange
End Sub
Private Sub Button65_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button65.Click
' Following code updates the active row if it has been modified. To test
' this sample code out, modify one or more cells and then call this method
' on the
Dim row As UltraGridRow = Me.ultraGrid1.ActiveRow
If Not row Is Nothing Then
' Check to see if the user has modified the data in the row.
If row.DataChanged Then
' Update the row. This will call EndEdit on the underlying data row.
row.Update()
Debug.WriteLine("After Update row.DataChanged = " & row.DataChanged)
Else
Debug.WriteLine("The row has not been modified since last updated.")
End If
Else
Debug.WriteLine("No active row.")
End If
End Sub