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

Edit form template insert and update buttons

1 Answer 219 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 26 May 2009, 10:23 AM

Hi,

 

I have two related questions.

1) If I define a custom edit form how can I achieve that both updating and inserting would work ?

If I use the following link button than also insert forms will execute an update command:
<asp:LinkButton runat="server" Text="Update" CommandName="Update" />

2) Which command name is used for inserting data ? ('Insert' did not work for me.)

Thanks.

1 Answer, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 26 May 2009, 10:36 AM
Hello Peter,

You can use the folowing code to toggle the text and visibility of the button in the FormTemplate:
aspx:
 <asp:LinkButton ID="btnUpdate" runat="server"  
Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'  
CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' /> 
                                    

The commandname that should be used to insert data is PerformInsert.
You can also refer to the following demo to understand better on creating a FormTemplate in grid:
Form Template Edit Form

Thanks
Princy.
Tags
Grid
Asked by
Peter
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or