vb.net - How to do textChanged event in datagridview? -


I am correcting the text change event for my datagrid view but I was not able to get that result, Whom i wanted. Whenever DataGridView1 should filter content Detagreed View2 I change the text on your cell / S I

It can filter the contents of my Detagreed View2, but before me outside Detagris cursor Click here / press Tab Here is my code:

  Private sub-DataGridView1_CellEndEdit (ByVal handles DataGridView1.CellEndEdit as the object, byVal e System.Windows.Forms.DataGridViewCellEventArgs). Con1 form OleDbConnection = thief con1.Open () as DT A. New DataTable Dim OleDbCommand = New OleDbCommand as _command dim () _command.Connection = con1 _command.CommandText = & amp "TABLE_NAME choose where *"; Such as content end; "" Dt.Load (_command.ExecuteReader) Me.dgv.DataSource = DT con1.Close () End Sub  

"likecontent" is where I store text on my dataGridView1.

Will my dataGridView2 be updated just by textChanged like the event from my dataGridView1?

You must use CellValueChangedEvent and CurrentCellDirtyStateChanged Events for this Personal sub dgv_CellValueChanged (as the object handles, as the E-DataGridViewCellEventArgs) handles DGV.

CellValueChanged Dim con1 As OleDbConnection = thief con1.Open () New DataTable Dim OleDbCommand as dt = new OleDbCommand () _command.Connection = con1 _command.CommandText = as _command choose where dim & Amp "* TABLE_NAME"; Such as content end; "Dt.Load (_command.ExecuteReader) Me.dgv.DataSource = dt con1.Close () end sub private all dgv_CurrentCellDirtyStateChanged (object as sender, and eventArgs handles) dgv.CurrentCellDirtyStateChanged if dgv.IsCurrentCellDirty then dgv. CommitEdit (DataGridViewDataErrorContexts.Commit) end if ending sub

Comments

Popular posts from this blog

ios - How do I use CFArrayRef in Swift? -

eclipse plugin - Run java code error: Workspace is closed -

c - Error on building source code in VC 6 -