How to access DataList from inside a NestedViewTemplate?

2 posts, 0 answers
  1. Bethany
    Bethany avatar
    14 posts
    Member since:
    Mar 2015

    Posted 14 Aug 2015 Link to this post



    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?




  2. Eyup
    Eyup avatar
    3936 posts

    Posted 19 Aug 2015 Link to this post

    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.

    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
Back to Top