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

How to access DataList from inside a NestedViewTemplate?

1 Answer 89 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Bethany
Top achievements
Rank 1
Bethany asked on 14 Aug 2015, 08:48 PM

Hello,

 

I am having trouble programmatically accessing a DataList control from within a NestedViewTemplate. I need to be able to pass a parent-grid data key item to an SQL connection and then data bind the results to the DataList in the code-behind. However, I am unable to find the DataList control and bind to it. Do you have any relevant information to assist me?

 

Thanks,

Bethany

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 19 Aug 2015, 11:19 AM
Hi Bethany,

In order to access the DataList using grid events, you can use the FindControl method. You can also use the DataList events, like DataBinding or Load, get a reference to it using the sender object and find the DataKeyValue of the master item using its NamingContainer, which is of type GridNestedViewItem.

Both of these methods are demonstrated in the attached web site sample. Please run the application and let me know if it helps you.

Regards,
Eyup
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
Bethany
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or