Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How Auto confirm CellValidating data when click other button
Message
De
13/11/2011 23:34:20
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
How Auto confirm CellValidating data when click other button
Versions des environnements
Environment:
VB 9.0
OS:
Windows XP
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01528796
Message ID:
01528796
Vues:
66
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
Répondre
Fil
Voir

Click here to load this message in the networking platform