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

[Solved] Radgrid update and insert edit forms at the same time

2 Answers 165 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jason Thacker
Top achievements
Rank 1
Jason Thacker asked on 19 Jan 2010, 04:43 PM
I have a grid with the ability to add and update items via the standard controls.

However, if I click to add a record and then click on "edit" on another record then both forms will be displayed at the same time. Is there any method of preventing this behavior to ensure that only one form or the other is displayed?

TIA,

  Jason

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 20 Jan 2010, 04:18 AM
Hello,

Try the following code snippet in order hide editform when insert form is showing and vice versa.

CS:
  
    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
Jason Thacker
Top achievements
Rank 1
answered on 20 Jan 2010, 02:14 PM
Thanks, that helped!
Tags
Grid
Asked by
Jason Thacker
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Jason Thacker
Top achievements
Rank 1
Share this question
or