To test automatic updates/inserts/deletes, I am using your sample app at: http://www.telerik.com/community/code-library/submission/b311D-kkmhe.aspx
It works fine for AutoGenerated edit form, but not for template form. To reproduce the problem, just paste the following code after closing columns tag (</COLUMNS>):
The returned error is:
It works fine for AutoGenerated edit form, but not for template form. To reproduce the problem, just paste the following code after closing columns tag (</COLUMNS>):
<EditFormSettings CaptionDataField="Edit contact:" ColumnNumber="2" EditFormType="Template" > |
<FormTemplate> |
<table id="ContactsMiddle" runat="server" style="width:100%; border:none 0px #ffffff; color:#9EB6CE; text-align:left;"> |
<tr> |
<td style="width:100px; padding-left:10px" >Last Name:</td> |
<td style="width:250px;"><asp:TextBox runat="server" EnableViewState="true" Width="70%" ID="inpContactName" Text='<%#Bind("LastName")%>'></asp:TextBox></td> |
<td style="width:100px; padding-left:10px" >First Name:</td> |
<td style="width:250px;"><asp:TextBox runat="server" EnableViewState="true" Width="70%" ID="inpContactHomePhone" Text='<%#Bind("FirstName")%>'></asp:TextBox></td> |
</tr> |
<tr> |
<td style="width:100px; padding-left:10px" >Title:</td> |
<td style="width:250px;"><asp:TextBox runat="server" EnableViewState="true" Width="70%" ID="inpContactEmail" Text='<%#Bind("Title")%>'></asp:TextBox></td> |
<td style="width:100px; padding-left:10px" >Address:</td> |
<td style="width:250px;"><asp:TextBox runat="server" EnableViewState="true" Width="70%" ID="inpContactCellPhone" Text='<%#Bind("Address")%>'></asp:TextBox></td> |
</tr> |
<tr> |
<td style="width:100px; padding-left:10px" >Date:</td> |
<td style="width:250px;"><asp:TextBox runat="server" EnableViewState="true" Width="70%" ID="TextBox1" Text='<%#Bind("HireDate")%>'></asp:TextBox></td> |
<td style="width:350px; padding-left:10px" colspan="2" > |
<asp:LinkButton CssClass="lnkSubmit" ID="btnOK" runat="server" CommandName="Update">OK</asp:LinkButton> |
<asp:LinkButton CssClass="lnkSubmit" ID="btnCancel" runat="server" CommandName="Cancel">Cancel</asp:LinkButton> |
</td> |
</tr> |
</table> |
</FormTemplate> |
</EditFormSettings> |
The returned error is:
You have specified that your update command compares all values on SqlDataSource 'SqlDataSource1', but the dictionary passed in for oldValues is empty. Pass in a valid dictionary for update or change your mode to OverwriteChanges.
I see only one example with edit form template on your web site, and that one is using non-standard data source and is visualy very difficult to follow. Not to mention dirty code with ? instead of parameter names and non-maximisable code window. Link: http://demos.telerik.com/ASPNET/Prometheus/Grid/Examples/DataEditing/TemplateFormUpdate/DefaultCS.aspx
Please let me know how to use custom template form for automatic operations.
Regards,
Alex