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

Insert button not working on Edit Pop up form

1 Answer 157 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Farhan
Top achievements
Rank 1
Farhan asked on 18 Nov 2011, 10:03 PM
Hi I am stuck on something which is frustrating mehopefully someone can help me out here, I have a Telerik grid with an Edit popup form. I have enabled automatic updates and inserts. For some reason the update on the page works but when I try to do an Insert
the button just stays there and does nothing. It does not go into the object data source Inserting event in the codebehind??  I dont understand what could be causing this, I thought initially it might be a client side function or even validation and i took them off still nothing. The update works fine but nothing happens when I click on insert.  I tried the "UseSubmitBehaviour" set to false as well since im not submitting client side. Can someone give me an idea what could be causing this, Here is what the submit button looks like, I am using it similarly on all the other pages and its working fine. Thanks looking forward to some guidance!

<asp:Button ID="BtnSubmit" UseSubmitBehavior="false" CausesValidation="true" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' ></asp:Button>
<asp:Button ID="BtnCancel"  Text="Cancel" runat="server" CausesValidation="false" CommandName="Cancel" ></asp:Button>

1 Answer, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 19 Nov 2011, 05:58 AM
Hello Farhan,

The correct code is below.

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


If above code is not working then set CausesValidation="False" to this button and check it was fire InsertCommand or not ??
-- if this code work then set Validation GroupName and remove CauseValidation property.
<asp:Button ID="btnUpdate" CausesValidation="False"  Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                    runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>

If the above code not helped then please provide your code so i can able to check and find the issue in it.

Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Farhan
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Share this question
or