Click here to Skip to main content
15,891,431 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionRe: Easy question Pin
Maximilien17-May-09 2:29
Maximilien17-May-09 2:29 
AnswerRe: Easy question Pin
Jarno Burger17-May-09 2:35
Jarno Burger17-May-09 2:35 
GeneralRe: Easy question Pin
Sebastian Schneider17-May-09 3:00
Sebastian Schneider17-May-09 3:00 
GeneralRe: Easy question Pin
Jarno Burger17-May-09 4:38
Jarno Burger17-May-09 4:38 
NewsRe: Easy question Pin
Troy Russell17-May-09 9:31
Troy Russell17-May-09 9:31 
GeneralRe: Easy question Pin
Dave Kreskowiak17-May-09 3:47
mveDave Kreskowiak17-May-09 3:47 
GeneralRe: Easy question Pin
Jarno Burger17-May-09 4:42
Jarno Burger17-May-09 4:42 
QuestionNeed To Repair - Datagridview Enter key in Editing mode -Cell Focus, Please ...Help me! Pin
Paramu197316-May-09 23:58
Paramu197316-May-09 23:58 
I have a class for MyDataGridView - To control the Enter Key , the below is working fine. But I canot focus to particular row for repeated values.

Actually if the user enters the repeated value, then the control has to move to that particular cell.
-------------------------------------------------

Public Class MyDataGrid
Inherits DataGridView

Protected Overloads Overrides Function ProcessDialogKey(ByVal keyData As Keys) As Boolean
If keyData = Keys.Enter Then
Dim col As Integer = Me.CurrentCell.ColumnIndex
Dim row As Integer = Me.CurrentCell.RowIndex
If Not (row = Me.NewRowIndex) Then
If col = (Me.Columns.Count - 1) Then
col = -1
row += 1
End If
Me.CurrentCell = Me(col + 1, row)
End If
Return True
End If
Return MyBase.ProcessDialogKey(keyData)
End Function

Protected Overloads Overrides Sub OnKeyDown(ByVal e As KeyEventArgs)
If e.KeyData = Keys.Enter Then
Dim col As Integer = Me.CurrentCell.ColumnIndex
Dim row As Integer = Me.CurrentCell.RowIndex
If Not (row = Me.NewRowIndex) Then
If col = (Me.Columns.Count - 1) Then
col = -1
row += 1
End If
Me.CurrentCell = Me(col + 1, row)
End If
e.Handled = True
End If
MyBase.OnKeyDown(e)
End Sub

End Class
----------------------------------------------
with my form

Private Sub MyDataGrid1_CellEndEdit(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles MyDataGrid1.CellEndEdit

If MyDataGrid1.CurrentCell.ColumnIndex = 0 Then
Dim RwNum As Integer = 0
Dim ep_id As String = Space(10)
ep_id = MyDataGrid1.CurrentCell.Value
RwNum = dbndf_52.Find("emp_id", ep_id)
If RwNum > 0 Then
MyDataGrid1.CurrentCell = MyDataGrid1(0, RwNum)
End If

End If

End sub

It's moving to that new row but again, retun to the previous row and moving to next column. This is my problem.

Anybody can help me to repair it? Smile | :)

Thanks
AnswerRe: Need To Repair - Datagridview Enter key in Editing mode -Cell Focus, Please ...Help me! Pin
Dave Kreskowiak17-May-09 3:44
mveDave Kreskowiak17-May-09 3:44 
GeneralRe: Need To Repair - Datagridview Enter key in Editing mode -Cell Focus, Please ...Help me! Pin
Paramu197317-May-09 4:41
Paramu197317-May-09 4:41 
GeneralRe: Need To Repair - Datagridview Enter key in Editing mode -Cell Focus, Please ...Help me! Pin
Dave Kreskowiak17-May-09 6:18
mveDave Kreskowiak17-May-09 6:18 
GeneralRe: Need To Repair - Datagridview Enter key in Editing mode -Cell Focus, Please ...Help me! Pin
Dave Kreskowiak17-May-09 17:22
mveDave Kreskowiak17-May-09 17:22 
GeneralRe: Need To Repair - Datagridview Enter key in Editing mode -Cell Focus, Please ...Help me! Pin
Paramu197317-May-09 19:07
Paramu197317-May-09 19:07 
Questionimport excel/csv file to axspreadsheet/DataGridview Pin
coolqer16-May-09 20:20
coolqer16-May-09 20:20 
AnswerRe: import excel/csv file to axspreadsheet/DataGridview Pin
Dave Kreskowiak17-May-09 3:43
mveDave Kreskowiak17-May-09 3:43 
GeneralRe: import excel/csv file to axspreadsheet/DataGridview Pin
coolqer17-May-09 4:12
coolqer17-May-09 4:12 
GeneralRe: import excel/csv file to axspreadsheet/DataGridview Pin
Dave Kreskowiak17-May-09 6:16
mveDave Kreskowiak17-May-09 6:16 
GeneralRe: import excel/csv file to axspreadsheet/DataGridview Pin
Mycroft Holmes17-May-09 21:51
professionalMycroft Holmes17-May-09 21:51 
GeneralRe: import excel/csv file to axspreadsheet/DataGridview Pin
coolqer18-May-09 1:20
coolqer18-May-09 1:20 
QuestionSend HTTP POST Pin
tkogx16-May-09 13:28
tkogx16-May-09 13:28 
AnswerRe: Send HTTP POST Pin
Dave Kreskowiak17-May-09 3:35
mveDave Kreskowiak17-May-09 3:35 
QuestionGlass Border on Borderless Window Pin
o m n i16-May-09 4:01
o m n i16-May-09 4:01 
AnswerRe: Glass Border on Borderless Window Pin
Dave Kreskowiak17-May-09 3:33
mveDave Kreskowiak17-May-09 3:33 
QuestionUsing a Vendors .Cer and .Key file and encrypt it with RSA - VB.net Pin
GSParker15-May-09 9:18
GSParker15-May-09 9:18 
AnswerRe: Using a Vendors .Cer and .Key file and encrypt it with RSA - VB.net Pin
leon991917-Aug-09 6:36
leon991917-Aug-09 6:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.