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

[Solved] Popup Edit Form closes automatically

2 Answers 132 Views
Grid
This is a migrated thread and some comments may be shown as answers.
wnl
Top achievements
Rank 1
wnl asked on 14 Jan 2010, 01:43 PM
Hi,
in RadGrid I'm using Popup Edit Form. When I inserted/updated a record this popup is closing. How to avoid this behavior and close the popup only if user clicks close button on the popup?

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 14 Jan 2010, 01:59 PM
Hello Jaromin,

To keep the EditForm from closing on clicking the UpdateButton or InsertButton you can try the following code:
c#:
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)  
    {  
        if (e.CommandName == RadGrid.UpdateCommandName)  // if (e.CommandName == RadGrid.PerformInsertCommandName)   
        {  
            //Update or Insert Query
  
            e.Canceled = true;  
        }  
    }  

Thanks
Princy.
0
Pavlina
Telerik team
answered on 14 Jan 2010, 02:27 PM
Hello Jaromin,

Another option to keep your Popup EditForm from closing is to try setting the following code immediately after the insert/update code.

C#:
RadGrid1.MasterTableView.IsItemInserted = true;  
e.Item.Edit = true;

Greetings,
Pavlina
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
wnl
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Pavlina
Telerik team
Share this question
or