i want value single cell.

3 posts, 0 answers
  1. Massimo
    Massimo avatar
    2 posts
    Member since:
    Feb 2012

    Posted 22 Feb 2012 Link to this post

    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. Shinu
    Shinu avatar
    17579 posts
    Member since:
    Mar 2007

    Posted 22 Feb 2012 Link to this post

    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.

  3. Tsvetoslav
    Admin
    Tsvetoslav avatar
    1823 posts
    Member since:
    Sep 2012

    Posted 24 Feb 2012 Link to this post

    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.

Back to Top