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

[Solved] Different EditModes for Insert & Update?

4 Answers 90 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Rob
Top achievements
Rank 1
Rob asked on 11 Nov 2009, 03:36 PM
I have a RadGrid with EditMode="InPlace" working just fine, but have a requirement that for Updates "InPlace" mode is needed and for Inserts "Popup" mode is needed.  On top of that, I need to use EditFormType="Template" for Popup mode only, because we don't want to see the Insert & Cancel links.  So I need to be able to toggle back and forth between these 2 modes and only 1 of the modes uses a template.  How can I best accomplish this?

Thanks,
Rob

4 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 12 Nov 2009, 04:12 AM
Hello Dudeman,

Check out the following code to achieve the required:
c#:
 protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
    { 
        if (e.CommandName == RadGrid.EditCommandName) 
        { 
            RadGrid1.MasterTableView.EditMode = GridEditMode.InPlace; 
        } 
        if(e.CommandName == RadGrid.InitInsertCommandName) 
        { 
            RadGrid1.MasterTableView.EditMode = GridEditMode.PopUp; 
            RadGrid1.MasterTableView.EditFormSettings.EditFormType = GridEditFormType.Template; 
        } 
    } 
         

Thanks
Princy.
0
Rob
Top achievements
Rank 1
answered on 12 Nov 2009, 03:50 PM
That does the trick.  Thanks!
0
Dylan
Top achievements
Rank 1
answered on 31 Jul 2013, 04:02 PM
This doesn't handle the case where an edit window and an insert window are both open at the same time.
0
Konstantin Dikov
Telerik team
answered on 05 Aug 2013, 01:44 PM
Hello Dylan,

For handling those cases, all opened for editing items should be closed by setting the Edit property to false. 

An example of the above and the switching between the edit modes, plus clearing all items that are currently in edit mode, is available in this thread.
 

Best Regards,
Konstantin Dikov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Rob
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Rob
Top achievements
Rank 1
Dylan
Top achievements
Rank 1
Konstantin Dikov
Telerik team
Share this question
or