Can we attach server side events for NestedViewTemplate controls ?

3 posts, 0 answers
  1. Ram
    Ram avatar
    8 posts
    Member since:
    Dec 2006

    Posted 10 Apr 2012 Link to this post

    Hi,

    I am having "NestedViewTemplate" with in the "MasterTableView".   ( RadGrid )

    In NestedViewTemplate, Some readonly controls, and three editable textboxes.
    In MasterTableView, i have some GridBoundColumn and a GridButtonColumn.

    My requirement is i need to update my source list, when your users enters text in nestedviewtemplate textbox.  Currently when ever i am clicking the enter key after giving some text in nestedviewtemplate textbox, its calling radgrid itemcommand event, since mastertable view contain a button column.

    Can i pass any command argument from the textbox ( inside the nestedview template ) to differentiate with masterview button click  (or) can we attach any server side event for the texboxes inside the nestedview template. ?


  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 10 Apr 2012 Link to this post

    Hello Ram,

    You can attach server side events to the TextBox in ItemCreated event as shown below.
    C#:
    protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
    {
      if (e.Item is GridNestedViewItem)
      {
        GridNestedViewItem item = (GridNestedViewItem)e.Item;
        TextBox txt = (TextBox)item.FindControl("TextBox1");
        txt.TextChanged += new EventHandler(txt_TextChanged);
      }
    }
     void txt_TextChanged(object sender, EventArgs e)
    {
     }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ram
    Ram avatar
    8 posts
    Member since:
    Dec 2006

    Posted 10 Apr 2012 Link to this post

    Thanks Princy, I hope this solution enough for now... :-)
Back to Top