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

Grid allowing simultaneously two operation Add New Row and Edit Row

2 Answers 41 Views
Grid
This is a migrated thread and some comments may be shown as answers.
nitish kumar
Top achievements
Rank 1
nitish kumar asked on 18 Mar 2010, 11:57 AM
Hi ,

I have one requirement like  prevent Adding New Row while any row of the grid in Edit mode and vice verse .

1. User Can not add the new row if any row of the grid in Edit mode
2. User can not Edit any row while any blank row exist [after click on "Add New Row" ] that means without completion of Add New Row

Please help on the same ASAP .

Nitish

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 18 Mar 2010, 01:23 PM

Hello Nitish,

Add the following code snippet in order hide editform when clicking "Add New Record" 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.

0
nitish kumar
Top achievements
Rank 1
answered on 19 Mar 2010, 04:43 PM
Shinu , Thanks very much.
It's worked for me.
Tags
Grid
Asked by
nitish kumar
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
nitish kumar
Top achievements
Rank 1
Share this question
or