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

Nested Grid

1 Answer 69 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sachin
Top achievements
Rank 1
Sachin asked on 29 Feb 2016, 05:50 PM

Hello,

I have used grid in <NestedViewTemplate>. I have added a button in column in grid in nestedviewtemplate.

How to access columns value on click of button of particular row.

How to find Nested grid and value of columns of nested grid on click of button in nested grid.

 

Thank you

 

 

1 Answer, 1 is accepted

Sort by
0
Accepted
Viktor Tachev
Telerik team
answered on 02 Mar 2016, 02:30 PM
Hi Sachin,

In order to access a value of one of the cells in the same row as the button you can use an approach similar to the following. The code snippet assumes that the Button is placed in a GridTemplateColumn in the nested RadGrid controls.


protected void Button1_Click(object sender, EventArgs e)
{
    GridDataItem dataItem = (sender as Button).NamingContainer as GridDataItem;
 
    // get value for some cell in the row where the button was clicked
    var value = dataItem["ColumnUniqueName"].Text;
}


In case you would like additional information on accessing cells and rows in RadGrid you would find the following article interesting.



Regards,
Viktor Tachev
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
Tags
Grid
Asked by
Sachin
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or