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

Reference a control in Page_Load

4 Answers 81 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Roy Halvorsen
Top achievements
Rank 1
Roy Halvorsen asked on 13 Aug 2009, 10:36 AM
How can I reference to a TextBox inside an EditFormTemplate in Page_Load (if IsPostBack = true) after editing an item in the EditFormTemplate?

4 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 13 Aug 2009, 10:52 AM
Hello Roy,

To see more information on the requested functionality, please refer to the following help article:
Referencing controls in grid row/edit form

Kind regards,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Roy Halvorsen
Top achievements
Rank 1
answered on 13 Aug 2009, 10:54 AM
Thanks, but that article does not answer my question.
0
Accepted
Princy
Top achievements
Rank 2
answered on 13 Aug 2009, 11:19 AM
Hello Roy,

You can loop through the Edit Item Collection and access the controls as shown below:
c#:
protected void Page_Load(object sender, EventArgs e) 
    { 
        if (IsPostBack) 
        { 
            foreach (GridEditableItem item in RadGrid1.EditItems
            { 
                TextBox txtbx = (TextBox)item["ColumnUniqueName"].Controls[0]; 
            } 
        } 
    } 

Thanks
Princy.
0
Roy Halvorsen
Top achievements
Rank 1
answered on 13 Aug 2009, 11:30 AM
Thanks, Princy !!!
Tags
Grid
Asked by
Roy Halvorsen
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
Roy Halvorsen
Top achievements
Rank 1
Princy
Top achievements
Rank 2
Share this question
or