Launch popup edit formtemplate from code behind

2 posts, 0 answers
  1. jlj30
    jlj30 avatar
    101 posts
    Member since:
    Jan 2011

    Posted 07 Mar 2012 Link to this post

    I would like to be able to navigate from several spots within my application and open up the edit formtemplate for a particular row in a RadGrid on another page.  I can pass the key thru a session variable.
    When the page loads, I would like the edit formtemplate (a popup) to automatically open with the data presented for the row with the passed key.

    Any guidance on an approach to accomplish this would be greatly appreciated.

    My alternative is to duplicate the rather complex formtemplate on other pages; something I'd rather not do.

    Thanks in advance.

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 08 Mar 2012 Link to this post


    I guess your requirement is to make the Radgrid in edit mode based on the Key value that you passed through session. If so please try the following code.
    protected void RadGrid1_PreRender(object sender, EventArgs e)
     if (!Page.IsPostBack)
      foreach (GridDataItem item in RadGrid1.Items)
       if (Session["OrderID"].ToString() == item.GetDataKeyValue("OrderID").ToString())
        item.Edit = true;

  3. DevCraft R3 2016 release webinar banner
Back to Top