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

EditMode in RadGrid

1 Answer 73 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Angella
Top achievements
Rank 1
Angella asked on 01 Nov 2012, 04:02 AM
Hi all,

In my Radgrid, I set the property EditMode with value "EditForms". I need to check if grid has new insert row when user try to click on GridEditCommandColumn to edit another row, since I want to prevent the user from adding new record and editing another one at the same time. Please provide some suggestions.


1 Answer, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 01 Nov 2012, 04:14 AM
Hi,

Please try the following code snippet to show either edit form or insert form at a time.

C#:
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
    {
       if (e.CommandName == RadGrid.EditCommandName)
        {
            if (RadGrid1.MasterTableView.IsItemInserted)
            {
                e.Canceled = true;
            }
        }
       if (e.CommandName == RadGrid.InitInsertCommandName)
       {
           if (RadGrid1.EditItems.Count > 0)
           {
               e.Canceled = true;
           }
       }
     }

Thanks,
Shinu.
Tags
Grid
Asked by
Angella
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or