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

[Solved] Insert/Edit Form

2 Answers 165 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Cameron Arnott
Top achievements
Rank 1
Cameron Arnott asked on 02 Nov 2009, 07:47 AM

I have a grid which used an Insert/Edit form.

When you Insert a new record, it inserts fine except.

Then Insert from clears and stays open, I would like it to close automatically.

When you Update, the update form also stays open, but I would like that to remain.

Any ideas?


Thanks.

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 02 Nov 2009, 09:53 AM
Hello,

You can try out the following code:
c#:
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
    { 
       // to close the insertform after insert 
        if (e.CommandName == RadGrid.PerformInsertCommandName) 
        {  
            // after inserting into database 
            e.Item.OwnerTableView.IsItemInserted = false
            e.Item.OwnerTableView.Rebind();  
        } 
       // to keep the editform from closing 
        if (e.CommandName == RadGrid.UpdateCommandName) 
        {           
            // after updating the database 
            e.Canceled = true;             
        }       
    } 

Thanks
Princy.
0
Cameron Arnott
Top achievements
Rank 1
answered on 02 Nov 2009, 10:58 PM


Cheers Dude!

Tags
Grid
Asked by
Cameron Arnott
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Cameron Arnott
Top achievements
Rank 1
Share this question
or