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

Help needed: "Add new record" button displays EditForm in edit(update) mode

1 Answer 19 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Riana Sattarova (Mamedova)
Top achievements
Rank 1
Riana Sattarova (Mamedova) asked on 25 May 2010, 09:44 AM
Hello,

Strange behavior: when "Add New Record" button is pressed on the RadGrid Command Item, EditForm (template) appears which contains "Update" and "Cancel" buttons. When clicking "Update", InsertCommand of the object data source or radgrid is not fired. What gets fired is the "UpdateCommand"
Has it been observed before? Would be grateful for any thoughts.

Thanks.

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 25 May 2010, 11:00 AM
Hello Riana,

Are you using FormTemplate for insert/editform. If so have you set the CommandName accordingly for insert and edit.

Aspx:
 
<asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'  runat="server"   
CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>  
</asp:Button> 

Here is the demo which shows same approach: Form Template Edit Form

Regards,
Princy.
Tags
Grid
Asked by
Riana Sattarova (Mamedova)
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or