This is a migrated thread and some comments may be shown as answers.

Programmatically Invoke Update for Template Edit Form

1 Answer 92 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Gary
Top achievements
Rank 1
Gary asked on 22 Jan 2009, 08:44 PM
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!

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 23 Jan 2009, 04:05 AM
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
Tags
Grid
Asked by
Gary
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or