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

i want value single cell.

2 Answers 44 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Massimo
Top achievements
Rank 1
Massimo asked on 22 Feb 2012, 02:01 PM
this is correct:

For Each item As GridDataItem In RadGrid1.SelectedItems
            Dim value As [String] = item("Priorità").Text.ToString()
            MsgBox(value)
        Next
       

but if i want value of single cell in row 0?

        Dim x As GridDataItem = RadGrid1.SelectedItems(0)
        Dim r As String = x("NameColumn").Text
        MsgBox(x)

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 22 Feb 2012, 02:18 PM
Hello,

You can access the cell value as shown below.
VB:
Protected Sub Button4_Click(sender As Object, e As EventArgs)
    Dim item As GridDataItem = DirectCast(grid.SelectedItems(0), GridDataItem)
    Dim value As String = item("UniqueName").Text
End Sub

-Shinu.
0
Tsvetoslav
Telerik team
answered on 24 Feb 2012, 08:27 AM
Hi Massimo,

You should use:
Dim x As GridDataItem = RadGrid1.SelectedItems(0)
Dim fieldValues As New Hashtable()
 x.ExtractValues(fieldValues)

After the last statement fieldValues will contain a key/value collection of all column fields and their values in the selected grid row.

Regards, Tsvetoslav
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Massimo
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Tsvetoslav
Telerik team
Share this question
or