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

Get valor of RowSelected

2 Answers 8 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Nagiza
Top achievements
Rank 1
Nagiza asked on 24 Sep 2015, 08:01 AM

hi

how  Get valor of RowSelected
example in gridview (traditional)

 

Protected Sub GridView1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles gvUsuario.SelectedIndexChanged

 'Here Code!!!!!!!

        Dim x as String

        Dim row As GridViewRow
        row = gvUsuario.SelectedRow
        ​x = gvUsuario.SelectedRow.Cells(1).Text
        MsgBox(x)

    End Sub

 

with RadGrid1 how would it be?

 

sorry my english

 

 

2 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 24 Sep 2015, 10:54 AM
Hello Nagiza,

Try the following approach:
Protected Sub RadGrid4_SelectedIndexChanged(sender As Object, e As EventArgs)
    If RadGrid4.SelectedItems.Count >= 1 Then
        Dim firstSelectedItem As GridDataItem = TryCast(RadGrid4.SelectedItems(0), GridDataItem)
        Dim cell As TableCell = firstSelectedItem("MyColumnName")
        Dim text As String = cell.Text
    End If
End Sub

Let me know whether this helps.

Regards,
Daniel
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Nagiza
Top achievements
Rank 1
answered on 25 Sep 2015, 05:51 AM
thank you,
if the code works
Tags
Grid
Asked by
Nagiza
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Nagiza
Top achievements
Rank 1
Share this question
or