Groups | Blog | Home
all groups > vb.net controls > march 2006 >

vb.net controls : How to cancel BindingNavigator's move action?


Jerry H.
3/27/2006 7:25:29 PM
How can I check the current row's values before the Binding Navigator
commits changes to the underlying list (datatable, actually).
Ken Tucker [MVP]
3/31/2006 7:31:50 PM
Hi,

Set the bindingnavigators movenextitem, movefirstitem,
movepreviousitem, and movelastitem action to none. Then you can handle the
event in code.

Private Sub BindingNavigatorMoveNextItem_Click(ByVal sender As Object,
ByVal e As System.EventArgs) Handles BindingNavigatorMoveNextItem.Click
Dim bIsValidData As Boolean = False ' Check if your data is valid
If bIsValidData Then
ComputerBindingSource.MoveNext()
Else
MessageBox.Show("Bad Data")
End If
End Sub

Ken
-----------------
[quoted text, click to view]

Jerry H.
4/3/2006 7:04:46 AM
thanks!
AddThis Social Bookmark Button