Get row index value in gridview

2 posts, 0 answers
  1. Hengky
    Hengky avatar
    41 posts
    Member since:
    Sep 2015

    Posted 05 Feb 2018 Link to this post

    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

  2. Hengky
    Hengky avatar
    41 posts
    Member since:
    Sep 2015

    Posted 06 Feb 2018 in reply to Hengky Link to this post

    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

     

     

     

Back to Top