Programmatically Invoke Update for Template Edit Form

2 posts, 0 answers
  1. Jay O'Brien
    Jay O'Brien avatar
    39 posts
    Member since:
    Dec 2008

    Posted 22 Jan 2009 Link to this post

    I am using the "Form template edit form" with EditMode="PopUp" to edit rows in my grid (it uses my ascx for a custom "edit" popup). Normally the user clicks the "Update" button to save the data (with a CommandName of Update). But when the user clicks the "OK" button on the main page, I want to save the values in the current edit popup (if there is one open). How do I invoke the "Update" for the open popup when someone hits just a button on the main page?

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

    Posted 22 Jan 2009 Link to this post

    Hi Jay,

    You can access controls in edit form in the click event of the button and then perform the Update operation.

    CS:
    protected void Button1_Click(object sender, EventArgs e) 
        { 
            foreach (GridEditFormItem editform in RadGrid1.MasterTableView.GetItems(GridItemType.EditFormItem)) 
            { 
                if (editform.IsInEditMode) 
                {
                   //access controls here
                    TextBox txtbx = (TextBox)editform.FindControl("TextBox1"); 
                  //Perform Update operation
                }
            } 
        } 


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