Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How Auto confirm CellValidating data when click other button
Message
From
13/11/2011 23:34:20
 
 
To
All
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
How Auto confirm CellValidating data when click other button
Environment versions
Environment:
VB 9.0
OS:
Windows XP
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01528796
Message ID:
01528796
Views:
65
Hi all,
I use vb.net ,BindingNavigator, Datagirdview(DataGridViewComboBoxColumn,DataGridViewTextBoxColumn).
First, user will click BindingNavigatorAddNewItem button to addnew row and entry data, he select the ComboBoxColumn value after he no press enter. And again click BindingNavigatorAddNewItem button .
Becuase he no press enter and havn't go to other cell., so the e.FormattedValue also DBNull in CellValidating.
Anyone know how to auto confirm CellValidating entry data when click other button.
I already try the below code but not ok . Thank you ~~~~
    Private Sub BindingNavigatorAddNewItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorAddNewItem.Click
        SendKeys.Send(Keys.Enter)
       SendKeys.Send(Keys.Tab)
        CurrateBindingSource.EndEdit()
        If checkCell() = True Then
            BindingNavigatorSaveItem.Enabled = False
            BindingNavigatorAddNewItem.Enabled = False
            CurrateBindingSource.AddNew()
        End If
    End Sub

                                                                            ' again click the BindingNavigatorAddNewItem button no trigger this method
Private Sub dg_CellLeave(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dg.CellLeave
        SendKeys.Send(Keys.Enter)
       SendKeys.Send(Keys.Tab)
    'End Sub
Reply
Map
View

Click here to load this message in the networking platform