This is a migrated thread and some comments may be shown as answers.

see row data

3 Answers 49 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
darwin mateo
Top achievements
Rank 1
darwin mateo asked on 05 Apr 2019, 01:31 AM

I want to see the data of my row when I click on it, what happens when grouping my grid does not take the correct data I hope you can help me I show my code :

Private Sub DgvProyectoGeneral_CellClick(sender As Object, e As GridViewCellEventArgs) Handles DgvProyectoGeneral.CellClick

Dim i As Integer
With DgvProyectoGeneral
If e.RowIndex >= 0 Then
i = .CurrentRow.Index
TxtIdExtraordinario.Text = .Rows(i).Cells("IdSolictud").Value.ToString
TxtCodigoExtraordinario.Text = .Rows(i).Cells("CodigoExtraodinario").Value.ToString
TxtDescripcionExtraodinario.Text = .Rows(i).Cells("DescripcionExtraordinario").Value.ToString
TxtCodigoMaterial.Text = .Rows(i).Cells("CodigoMaterial").Value.ToString
TxtDescripcionMaterial.Text = .Rows(i).Cells("DescripcionMaterial").Value.ToString
End If
End With
End Sub

3 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 05 Apr 2019, 12:51 PM
Hi Darwin,

The indexes are changed when the grid is grouped. detailed information about this is available here: Rows vs ChildRows. A better solution is to access the cells directly without using the row index. For example:
Private Sub RadGridView1_CellClick(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.GridViewCellEventArgs)
    Dim text1 = e.Row.Cells("Name").Value.ToString()
End Sub

I hope this helps. Should you have any other questions do not hesitate to ask.

Regards,
Dimitar
Progress Telerik
Get quickly onboard and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
darwin mateo
Top achievements
Rank 1
answered on 05 Apr 2019, 03:21 PM
I read the article but I did not find the solution to my problem, you will have another example to get the data from my cell and show them in my radtext, the problem is when I group the radgrid
0
Dimitar
Telerik team
answered on 08 Apr 2019, 09:46 AM
Hello Darwin,

I am not sure why the suggested approach does not work on your side. I have attached my test project which contains a grouped grid. Could you please check it and let me know what I am doing wrong?

Thank you in advance for your patience and cooperation. 

Regards,
Dimitar
Progress Telerik
Get quickly onboard and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
General Discussions
Asked by
darwin mateo
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
darwin mateo
Top achievements
Rank 1
Share this question
or