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

Using a demo as a template how to do this

2 Answers 54 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Santos
Top achievements
Rank 1
Santos asked on 12 Jan 2011, 05:38 PM

Using this demo as a template

http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/usercontroleditform/defaultcs.aspx

How can i click "add" and when i click on "edit" on another row it automatically close the add function. as an example when you click on edit on a row if you click onedit on another row the previous one is closed.

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 13 Jan 2011, 05:37 AM
Hello Santos,

Add the following code snippet to hide insertform when clicking edit 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();
       }
   }

Thanks,
Princy.
0
Santos
Top achievements
Rank 1
answered on 13 Jan 2011, 03:11 PM
Thanks so much 4 the answer, it works :D
Tags
Grid
Asked by
Santos
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Santos
Top achievements
Rank 1
Share this question
or