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

Accessing Controls inside NestedTableView

3 Answers 71 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 20 Nov 2008, 02:58 PM
Hi,

I have a RadGrid which contains several controls inside it's NestedTableView. Now I need to access these controls from the codebehind. How can I do this?

Best regards,
Robert

3 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 20 Nov 2008, 04:35 PM
Hello Robert,

A possible approach is shown below:
protected void Page_PreRender(object sender, EventArgs e) 
    GridNestedViewItem nestedItem; 
    if(RadGrid1.MasterTableView.GetItems(GridItemType.NestedView).Length != 0) 
    { 
        nestedItem = RadGrid1.MasterTableView.GetItems(GridItemType.NestedView)[0] as GridNestedViewItem; 
        TextBox textbox = nestedItem.FindControl("TextBox1"as TextBox; 
        textbox.Text = "CUSTOM"
    } 

Let us know if you have more questions.

Best regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Robert
Top achievements
Rank 1
answered on 20 Nov 2008, 05:37 PM
Hi Daniel,

unfortunately your approach does not work for me. The MasterTable's Items collection does not contain any elements.
Do you have any suggestion what's wrong here? 

0
Daniel
Telerik team
answered on 20 Nov 2008, 06:41 PM
Hello Robert,

Please examine the attached example and let me know whether it's working on your end.

Kind regards,
Daniel
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Grid
Asked by
Robert
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Robert
Top achievements
Rank 1
Share this question
or