see row data

4 posts, 0 answers
  1. darwin mateo
    darwin mateo avatar
    2 posts
    Member since:
    Jan 2019

    Posted 04 Apr Link to this post

    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

  2. Dimitar
    Admin
    Dimitar avatar
    2686 posts

    Posted 05 Apr Link to this post

    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.
  3. darwin mateo
    darwin mateo avatar
    2 posts
    Member since:
    Jan 2019

    Posted 05 Apr in reply to Dimitar Link to this post

    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
  4. Dimitar
    Admin
    Dimitar avatar
    2686 posts

    Posted 08 Apr Link to this post

    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.
Back to Top