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

How to access Radgrid inside the NestedViewTemplate.

5 Answers 928 Views
Grid
This is a migrated thread and some comments may be shown as answers.
giridhar
Top achievements
Rank 1
giridhar asked on 13 Mar 2009, 10:20 AM
Hi,
  My current requirement demands to have a radgrid inside the nestedview template.On page load I should be able to access this grid. Can I know how to access items inside a nestedvieetemplate on page load.

This is a major requirement for me. Please do let me know.

Thanks and regards,
Giridhar.

5 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 16 Mar 2009, 04:55 AM
Hi Giridhar,

You can access the Grid from the NestedViewTemplate in the PageLoad event once you expand the Master table row as shown below.

CS:

protected
 void Page_Load(object sender, EventArgs e) 
    { 
        foreach (GridDataItem item in RadGrid1.MasterTableView.Items) 
        { 
            if (!item.Expanded) 
            { 
                GridNestedViewItem nestedItem = (GridNestedViewItem)item.ChildItem; 
                RadGrid ChildGrid = (RadGrid)nestedItem.FindControl("RadGrid2"); 
            } 
        } 
         
    } 


Thanks
Shinu
0
giridhar
Top achievements
Rank 1
answered on 18 Mar 2009, 05:15 AM
I should be able to access the nestedviewtemplate on page_init, so that I can place the controls dynamically in the nestedview template.. Is there a way to do this?
0
giridhar
Top achievements
Rank 1
answered on 18 Mar 2009, 05:17 AM
Infact I have a grid inside the nestedviewtemplate whose columns needs to added dynamically
0
giridhar
Top achievements
Rank 1
answered on 18 Mar 2009, 05:30 AM
I don't want to add the columns to this grid when the item gets expanded, instead I want to restructure the template itself, so that it is applied for all the time nested view template is expanded.
0
Yavor
Telerik team
answered on 18 Mar 2009, 07:29 AM
Hi giridhar,

On pageInit, the controls on the page, including the grid itself, will not be populated with data, nor restored to their state. Hence, accessing a control would not give you access to its value(s).

Kind regards,
Yavor
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.
Tags
Grid
Asked by
giridhar
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
giridhar
Top achievements
Rank 1
Yavor
Telerik team
Share this question
or