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

On Save button click how to get ItemTemplate label value inside the GridTableView?

1 Answer 145 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Teju
Top achievements
Rank 1
Teju asked on 08 Jan 2015, 06:17 AM
On save button click i want to save the values stored in all my ItemTemplate's Label which is inside GridTableView of a RadGrid.

I 'm not sure how to write the foreach statement on Save button click to get the those.

My Efforts-

protected void btnSave_Click(...)
{
     foreach(GridDataItem item in rgScopeOfWork.MasterTabelView.Items)
     {
          // here we can get only those which are outside of the GridTableView 
     }
}

How to write foreach ​to get to loop through the columns inside GridTableView?

Thanks . 

1 Answer, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 12 Jan 2015, 04:53 PM
Hello,

Try with the following code:
protected void btnSave_Click(object sender, EventArgs e)
 {
     foreach (GridDataItem item in rgScopeOfWork.Items)
     {
        Label label = (Label)item["ColUniqueName"].FindControl("Label1");
     }
 }

Regards,
Pavlina
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Grid
Asked by
Teju
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Share this question
or