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

[Solved] Grid Cancel command

1 Answer 155 Views
Grid
This is a migrated thread and some comments may be shown as answers.
PM
Top achievements
Rank 1
PM asked on 17 Mar 2010, 12:13 PM
Hi All,

I gave a RadGrid with AddNewRecord option and edit option.

How can i cancel the editmode when i click on AddNewRecord and vice versa.

My senario is, if i click on edit grid will show edit mode, now with out canceling the edit mode, i will click on addnewrecord, then i want to cancel the edit mode and show insert mode.

How can i achieve this. Please help me regarding this.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 17 Mar 2010, 01:37 PM

Hello,

Add the following code snippet in order hide editform when clicking insert and vice versa.

C#:

 
    protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)   
    {   
        if (e.CommandName == RadGrid.EditCommandName)   
        {   
            RadGrid1.MasterTableView.IsItemInserted = false;   
        }   
        if (e.CommandName == RadGrid.InitInsertCommandName)   
        {   
            RadGrid1.MasterTableView.ClearEditItems();   
        }   
    }  

-Shinu.

Tags
Grid
Asked by
PM
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or