This is a migrated thread and some comments may be shown as answers.
Get row index value in gridview
1 Answer 42 Views
This is a migrated thread and some comments may be shown as answers.
Hengky
Top achievements
Rank 1
Hengky asked on 06 Feb 2018, 04:00 AM

Hello,

How to get row index / position on validating ... ? 

i have use this code 

       Dim baris As Integer = GridDetail.CurrentRow.Index 

and the return always -1 

how to fix this...  ?

*i use vb.net

Thanks

1 Answer, 1 is accepted

Sort by
0
Hengky
Top achievements
Rank 1
answered on 06 Feb 2018, 06:10 AM

Sorry not on validating but on cellvaluechanged...

This the code i wrote 

    Private Sub GridDetail_CellValueChanged(sender As Object, e As GridViewCellEventArgs) Handles GridDetail.CellValueChanged
        If e.Column.Name = "Kode" Then
            MsgBox(e.Row.Cells(0).Value.ToString & ", " & e.RowIndex & ", " & e.ColumnIndex)
        End If
    End Sub

for the first time it get -1, 0. How to get the real position ? i mean 0,0 for rowindex and columnindex

 

Thanks

 

 

 

Asked by
Hengky
Top achievements
Rank 1
Answers by
Hengky
Top achievements
Rank 1
Share this question
or