Home Forums WinForms controls Xceed Grid for WinForms CurrentRow Reply To: CurrentRow

User (Old forums)
Member
Post count: 23064

I have tried this code :

If GridControl1.CurrentRow IsNot Nothing Then
            Dim value As String = DirectCast(GridControl1.CurrentRow, xceed.Grid.DataRow).Cells(0).Value.ToString()
            Dim rowNumber As Integer = GridControl1.DataRows.IndexOf(DirectCast(GridControl1.CurrentRow, xceed.Grid.DataRow))
            MsgBox(“value : ” & value)
            MsgBox(“rowNumber : ” & rowNumber)
        End If

And i have that :

value : 6 (it’s the correct value)

rowNumber : -1 (not correct)

How can i do ?

 

(I have juste found the solution. We have to browse all the tree. For example i have the right number for the first path by using this code : GridControl1.DataRows(0).DetailGrids(0).DataRows(0).DetailGrids(0).DataRows.Count)

 

 

 

 

Imported from legacy forums. Posted by yohannc (had 1382 views)