Nice work
But i have one problem and dont know how to solve it. I already have appplication with a lot of combos and textboxes on form (32 rows, in each row 5 combos and 5 texboxes and lot of code behind). Problem is that curent app is very slow on form load. With your sample i could make it a lot faster.
Already have gridview filled with some test data.
And the problem is:
When i click on combobox in use this code to display dropdown (to click only once to display dropdown).
When i click on item in dropdown the cell is filled with selected text. But CellValueChanged event is fired when i go out from cel in clicked on other cell. Now how i set that value is changed when i click on item in dropdown, or to catch this event?Code:Private Sub DataGridView1_CellMouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellMouseEventArgs) Handles DataGridView1.CellMouseClick Try If e.RowIndex = -1 Then Exit Sub Select Case e.ColumnIndex Case 0, 2, 4, 6, 8 DataGridView1.BeginEdit(True) Dim controll As DataGridViewComboBoxEditingControl = DataGridView1.EditingControl If controll IsNot Nothing Then controll.DroppedDown = True End If End Select Catch ex As Exception MsgBox(ex.Message & " " & e.RowIndex & " " & e.ColumnIndex) End Try End Sub Private Sub gwKupuje_DataError(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewDataErrorEventArgs) Handles DataGridView1.DataError If e.Context = DataGridViewDataErrorContexts.Formatting _ Or e.Context = DataGridViewDataErrorContexts.PreferredSize Then e.ThrowException = False End If End Sub
I need this for enable or disable (ready only) next cell in gridview.
An one more thing.
I want to add one column in gridview like row number, starting with 0.




Reply With Quote