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

Get the values from Child Grid in the heirarchy grid.

2 Answers 57 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sagar
Top achievements
Rank 1
Sagar asked on 19 Nov 2010, 01:40 PM
Hi ,i have one problem , that i have a Parent Grid and a Child Grid, and i want to have the values from the cells of Child Grid on mouse click . So that i can show that value, But i am not able to get it. I have attached the PIC of my datagrid, i want the  value of Kroner.Please Help..

I hope you get the problem.

Please Help....

2 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 19 Nov 2010, 02:09 PM
Hello,

Please see the answer in your other thread here. May i also suggest only asking a question in one thread as this may slow down response times.

If you need more information however, please just let me know.
Thanks
Richard
0
Emanuel Varga
Top achievements
Rank 1
answered on 20 Nov 2010, 01:12 AM
Hello Sagar,

As a plus to the information Richard has provided you could also get the CurrentCell value, the CurrentRow values, or the DataBoundItem for the current row in the Cell.Click event like so:
void radGridView1_CellClick(object sender, GridViewCellEventArgs e)
{
    // to get the current cell value
    var currentCellValue = radGridView1.CurrentCell.Value;
 
    //to get the current row
    var currentRow = radGridView1.CurrentRow;
    // or
    currentRow = radGridView1.CurrentCell.RowInfo;
 
    //to get the databound Item, if you are using a bound grid;
    var dataBoundItem = radGridView1.CurrentRow.DataBoundItem;
    //or
    dataBoundItem = radGridView1.CurrentCell.RowInfo.DataBoundItem;
 
    // show the value of the current cell
    MessageBox.Show(radGridView1.CurrentCell.Value.ToString());
}

Hope this helps, if you have any other questions or comments, please let me know,

Best Regards,
Emanuel Varga
Telerik WinForms MVP
Tags
GridView
Asked by
Sagar
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Emanuel Varga
Top achievements
Rank 1
Share this question
or