Gjoreski | 09.03.2018 13:05 |
---|---|
Predmet:Re: Enter kao tab u DataGridView kako? Super sta si uspeo. |
xl_kid | 09.03.2018 12:07 |
---|---|
Predmet:Re: Enter kao tab u DataGridView kako? Ovo mi sad pravi problem inače radi baz njega Private Sub CustomDataGridView1_CellEndEdit(sender As Object, e As DataGridViewCellEventArgs) Handles CustomDataGridView1.CellEndEdit Dim naziv_proizvoda As New Porudzbine_DataSetTableAdapters.ProizvodiTableAdapter If e.ColumnIndex = 0 Then If Val(CustomDataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value) > 0 Then CustomDataGridView1.Rows(e.RowIndex).Cells(e.ColumnIndex + 1).Value = naziv_proizvoda.NazivProizvoda_ScalarQuery(CInt(Val(CustomDataGrid View1.Rows(e.RowIndex).Cells(e.ColumnIndex).Value))) End If End If End Sub |
xl_kid | 09.03.2018 12:32 |
---|---|
Predmet:Re: Enter kao tab u DataGridView kako? Uspeo sam ![]() Public Class CustomDataGridView Inherits DataGridView Protected Overloads Overrides Function ProcessDialogKey(ByVal keyData As Keys) As Boolean If keyData = Keys.Enter Then MyBase.ProcessTabKey(Keys.Tab) Return True End If Return MyBase.ProcessDialogKey(keyData) End Function Protected Overloads Overrides Function ProcessDataGridViewKey(ByVal e As KeyEventArgs) As Boolean If e.KeyCode = Keys.Enter Then MyBase.ProcessTabKey(Keys.Tab) Return True End If Return MyBase.ProcessDataGridViewKey(e) End Function End Class Pozvao sam ovaj DGV i u proprterties EditMode promenio na EditOnEnter Radi ![]() |
xl_kid | 09.03.2018 12:01 |
---|---|
Predmet:Re: Enter kao tab u DataGridView kako? Probao sam i sa custom. Tu me prabaci za 2 polja desno ako ima edit polja a ako nema vrati me na prvo polje master forme. Evo cod Public Class CustomDataGridView Inherits DataGridView Dim celWasEndEdit As DataGridViewCell Private _EnterMoveNext As Boolean = True <System.ComponentModel.DefaultValue(True)> _ Public Property OnEnterKeyMoveNext() As Boolean Get Return Me._EnterMoveNext End Get Set(ByVal value As Boolean) Me._EnterMoveNext = value End Set End Property Private Sub DataGridView_CellEndEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles Me.CellEndEdit Me.celWasEndEdit = Me(e.ColumnIndex, e.RowIndex) End Sub Private Sub DataGridView_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.SelectionChanged ' if Enter Move Next should work andalso ' mouse button was NOT down ' we are checking mouse buttons because if select was changed ' by Mouse then we will NOT do our Enter Move Next If Me._EnterMoveNext AndAlso MouseButtons = 0 Then ' if selection is changed after Cell Editing If Me.celWasEndEdit IsNot Nothing AndAlso _ Me.CurrentCell IsNot Nothing Then ' if we are currently in the next line of last edit cell If Me.CurrentCell.RowIndex = Me.celWasEndEdit.RowIndex + 1 AndAlso _ Me.CurrentCell.ColumnIndex = Me.celWasEndEdit.ColumnIndex Then Dim iColNew As Integer Dim iRowNew As Integer ' if we at the last column If Me.celWasEndEdit.ColumnIndex >= Me.ColumnCount - 1 Then iColNew = 0 ' move to first column iRowNew = Me.CurrentCell.RowIndex ' and move to next row Else ' else it means we are NOT at the last column ' move to next column iColNew = Me.celWasEndEdit.ColumnIndex + 1 ' but row should remain same iRowNew = Me.celWasEndEdit.RowIndex End If Me.CurrentCell = Me(iColNew, iRowNew) ' ok set the current column End If End If Me.celWasEndEdit = Nothing ' reset the cell end edit End If End Sub End Class |
xl_kid | 09.03.2018 08:15 |
---|---|
Predmet:Re: Enter kao tab u DataGridView kako? Javlja mi greÅ¡ku e.keychar is not a member of system.windows.forms.KeyEventArgs probao sam na Private Sub PorudzbineDetaljiDataGridView_KeyPress ali se ne deÅ¡ava niÅ¡ta. Ide red dole umesto sledeće polje. |
Gjoreski | 09.03.2018 10:57 |
---|---|
Predmet:Re: Enter kao tab u DataGridView kako? Moras setirati DataGridView.EditMode kao EditOnEnter da bi radio ova : PreuzmiIzvorni kôd (vbnet):
|
Gjoreski | 09.03.2018 10:59 |
---|---|
Predmet:Re: Enter kao tab u DataGridView kako? Eve uste edno resenie probaj go i ova PreuzmiIzvorni kôd (Visual Basic):
|
xl_kid | 09.03.2018 11:09 |
---|---|
Predmet:Re: Enter kao tab u DataGridView kako? Opet ide red ispod. |
xl_kid | 09.03.2018 11:28 |
---|---|
Predmet:Re: Enter kao tab u DataGridView kako? Hajde da pitam... Možda ovo Å¡to radim nije ispravno. DataGridView sam stavio da mi bude kao u access subforma. U prvom polju (1) unosim Å¡ifru proizvoda u drugom (2)mi automatski izlazi naziv proizvoda (to polje bi trebalo da preskočim i fokus da stavim na sledeće polje), (3) polje je za komade, (4) transportna pakovanja i (5) težina. Polja 3, 4 i 5 su numerička i tu se unosi ili komadi ili kutije ili težina. |
Gjoreski | 08.03.2018 15:26 |
---|---|
Predmet:Re: Enter kao tab u DataGridView kako? Eve ti cod za ovaj problem : na onKey_Down stavi go ova PreuzmiIzvorni kôd (Visual Basic):
Ova e za VB6 i VBA Eve za vb Net PreuzmiIzvorni kôd (vbnet):
|