How to access controls in a nestedViewTemplate in the event ItemCommand?

2 posts, 0 answers
  1. Gregory
    Gregory avatar
    15 posts
    Member since:
    Mar 2014

    Posted 16 May Link to this post

    Hello,

    As the title says it, I would like to know how to get the value of a text box in my nestedViewTemplate while I am in the ItemCommand event.

    When I cast the Telerik.Web.UI.GridCommandEventArgs e to a GridNestedViewItem, it says the cast is wonrg. If I cast it to GridDataItem, then my text box is after I used FindControl("myTextBoxID")

    What would be the way to do that please?

     

    Thank you

  2. Gregory
    Gregory avatar
    15 posts
    Member since:
    Mar 2014

    Posted 17 May Link to this post

    I found the answer myself:

    TextBox tbMessage = (e.Item as GridDataItem).ChildItem.FindControl("tbMessage") as TextBox;

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top