Hi,
I've created a simple Grid, and set it to use the popup edit mode (I've just copied directly from the samples).
I've also created my own code for the Update and Insert commands - again largely copied from the samples.
When invoking the popup to edit an existing row, after clicking the Update button my code fires, and the data is updated however the Popup form doesn't close automatically.
However, when invoking the popup to add a new row it works perfectly and the popup closes.
Here's the code for my grid:
Any suggestions?
Thanks,
Neil.
I've created a simple Grid, and set it to use the popup edit mode (I've just copied directly from the samples).
I've also created my own code for the Update and Insert commands - again largely copied from the samples.
When invoking the popup to edit an existing row, after clicking the Update button my code fires, and the data is updated however the Popup form doesn't close automatically.
However, when invoking the popup to add a new row it works perfectly and the popup closes.
Here's the code for my grid:
| <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" |
| AllowPaging="True" AllowSorting="True" GridLines="None" Skin="Sitefinity" |
| AutoGenerateColumns="False" AllowAutomaticUpdates="True" AutoGenerateEditColumn="true" > |
| <MasterTableView EditMode="PopUp" CommandItemDisplay="Top" DataKeyNames="ItemCode" > |
| <EditFormSettings InsertCaption="Add new item" CaptionFormatString="Edit Item: {0}" |
| CaptionDataField="ItemCode" PopUpSettings-Modal="true" EditFormType="Template" > |
| <EditColumn UniqueName="EditCommandColumn1"></EditColumn> |
| <FormTemplate> |
| <table id="Table1" cellspacing="1" cellpadding="1" width="80%" border="0"> |
| <tr> |
| <td> |
| </td> |
| <td> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| Branch: |
| </td> |
| <td> |
| <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind( "Branch" ) %>'> |
| </asp:TextBox> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| Item Code: |
| </td> |
| <td> |
| <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind( "ItemCode") %>' TabIndex="1"> |
| </asp:TextBox> |
| </td> |
| </tr> |
| <tr> |
| <td> |
| Description: |
| </td> |
| <td> |
| <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind( "ItemDescription") %>' TabIndex="2"> |
| </asp:TextBox> |
| </td> |
| </tr> |
| </table> |
| <table style="width: 100%"> |
| <tr> |
| <td align="right" colspan="2"> |
| <asp:Button ID="Button1" Text='<%# Iif (TypeOf Container is GridEditFormInsertItem, "Insert", "Update") %>' |
| runat="server" CommandName='<%# Iif (TypeOf Container is GridEditFormInsertItem, "PerformInsert", "Update") %>'> |
| </asp:Button> |
| <asp:Button ID="Button2" Text="Cancel" runat="server" CausesValidation="False" CommandName="Cancel"> |
| </asp:Button> |
| </td> |
| </tr> |
| </table> |
| </FormTemplate> |
| <PopUpSettings Modal="True"></PopUpSettings> |
| </EditFormSettings> |
| <Columns> |
| <telerik:GridBoundColumn DataField="Branch2.BranchName" HeaderText="Branch" |
| UniqueName="column1"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="ItemCode" HeaderText="Item" |
| UniqueName="column3"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="ItemDescription" |
| HeaderText="Item Description" UniqueName="column2"> |
| </telerik:GridBoundColumn> |
| <telerik:GridBoundColumn DataField="Status2.StatusName" HeaderText="Status" |
| UniqueName="column"> |
| </telerik:GridBoundColumn> |
| </Columns> |
| </MasterTableView> |
| <ClientSettings> |
| <ClientEvents OnRowDblClick="RowDblClick" /> |
| </ClientSettings> |
| </telerik:RadGrid> |
Any suggestions?
Thanks,
Neil.