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

Help

2 Answers 108 Views
GridView
This is a migrated thread and some comments may be shown as answers.
moh amm
Top achievements
Rank 1
moh amm asked on 23 Nov 2010, 01:28 PM
Hi
I have a hierarchy gridview.
how I can get the value of a specific cell in a specific row in the subgrid which name is GridViewTemplate1.  

2 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 23 Nov 2010, 01:35 PM
Hello,

How are you planning to get the value? Do you have specific requirements for getting to the value of a specific cell?

You can get to the value of any cell that you click on for exmaple by subscribing to the CellClick event
Private Sub RadGridView1_CellClick(ByVal sender As System.Object, ByVal e As Telerik.WinControls.UI.GridViewCellEventArgs) Handles RadGridView1.CellClick
    MessageBox.Show(e.Value.ToString())
End Sub

If you need further information, please just let me know
Richard
0
Richard Slade
Top achievements
Rank 2
answered on 23 Nov 2010, 03:00 PM
Hello,
here is more information for you too to get other information from the clicked cell.

Please let me know if you need more information or mark as answer if this has helped
thanks
Richard

Private Sub radGridView1_CellClick(sender As Object, e As GridViewCellEventArgs) Handles RadGridView1.CellClick
    ' to get the current cell value
    Dim currentCellValue = radGridView1.CurrentCell.Value
  
    'to get the current row
    Dim currentRow = radGridView1.CurrentRow
    ' or
    currentRow = radGridView1.CurrentCell.RowInfo
  
    'to get the databound Item, if you are using a bound grid;
    Dim dataBoundItem = radGridView1.CurrentRow.DataBoundItem
    'or
    dataBoundItem = radGridView1.CurrentCell.RowInfo.DataBoundItem
  
    ' show the value of the current cell
    MessageBox.Show(radGridView1.CurrentCell.Value.ToString())
End Sub
Tags
GridView
Asked by
moh amm
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Share this question
or