(question from a noob)
I'm stuck, and couldn't find my answer. So here it goes:
I made a grid with (w/ one detail or child table). I utilized the auto update, add and delete options but it only works with the child table. The parent one doesn't seem to update nor delete any record at all.
Can't seem to follow the demo too.Any direction is appreciated!
<asp:Panel ID="Panel1" runat="server"> <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> <AjaxSettings> <telerik:AjaxSetting AjaxControlID="RadGrid1"> <UpdatedControls> <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" /> </UpdatedControls> </telerik:AjaxSetting> </AjaxSettings> </telerik:RadAjaxManager> <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" /> <telerik:RadFormDecorator RenderMode="Lightweight" runat="server" DecorationZoneID="demo" EnableRoundedCorners="false" DecoratedControls="All" /> <div id="demo" class="demo-container no-bg"> <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" GroupPanelPosition="Top" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AllowPaging="True" Skin="Black" GroupingSettings-GroupContinuesFormatString=" Group continues on the next page." MasterTableView-CommandItemDisplay="Top" EditItemStyle-HorizontalAlign="Right" MasterTableView-EditMode="EditForms" MasterTableView-EnableColumnsViewState="True" GroupingSettings-GroupSplitDisplayFormat="Showing {0} of {1} items." AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True"> <MasterTableView DataKeyNames="JobFunction" DataSourceID="SqlDataSource1" AutoGenerateColumns="False"> <DetailTables> <telerik:GridTableView runat="server" DataKeyNames="EmployeeIndex" DataSourceID="SqlDataSource2" CommandItemDisplay="Top"> <ParentTableRelation> <telerik:GridRelationFields MasterKeyField="JobFunction" DetailKeyField="JobFunction"></telerik:GridRelationFields> </ParentTableRelation> <EditFormSettings> <EditColumn UniqueName="EditCommandColumn1" FilterControlAltText="Filter EditCommandColumn1 column"></EditColumn> </EditFormSettings> </telerik:GridTableView> </DetailTables> <CommandItemSettings AddNewRecordText="Add New Function" ShowExportToExcelButton="True" ShowExportToPdfButton="True"></CommandItemSettings> <Columns> <telerik:GridClientDeleteColumn FilterControlAltText="Filter column column" UniqueName="column"></telerik:GridClientDeleteColumn> <telerik:GridEditCommandColumn></telerik:GridEditCommandColumn> <telerik:GridBoundColumn DataField="JobFunctionIndex" ReadOnly="True" HeaderText="JobFunctionIndex" SortExpression="JobFunctionIndex" UniqueName="JobFunctionIndex" DataType="System.Int32" FilterControlAltText="Filter JobFunctionIndex column"></telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="JobFunction" HeaderText="JobFunction" SortExpression="JobFunction" UniqueName="JobFunction" FilterControlAltText="Filter JobFunction column"></telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Description" HeaderText="Description" SortExpression="Description" UniqueName="Description" FilterControlAltText="Filter Description column"></telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Profile1" HeaderText="Profile1" SortExpression="Profile1" UniqueName="Profile1" FilterControlAltText="Filter Profile1 column"></telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Profile2" HeaderText="Profile2" SortExpression="Profile2" UniqueName="Profile2" FilterControlAltText="Filter Profile2 column"></telerik:GridBoundColumn> </Columns> </MasterTableView> </telerik:RadGrid> <asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString='<%$ ConnectionStrings:SiteSqlServer %>' SelectCommand="SELECT * FROM [Bak-JobFunction]" DeleteCommand="DELETE FROM [Bak-JobFunction] WHERE [JobFunctionIndex] = @JobFunctionIndex" InsertCommand="INSERT INTO [Bak-JobFunction] ([JobFunction], [Description], [Profile1], [Profile2]) VALUES (@JobFunction, @Description, @Profile1, @Profile2)" UpdateCommand="UPDATE [Bak-JobFunction] SET [JobFunction] = @JobFunction, [Description] = @Description, [Profile1] = @Profile1, [Profile2] = @Profile2 WHERE [JobFunctionIndex] = @JobFunctionIndex"> <DeleteParameters> <asp:Parameter Name="JobFunctionIndex" Type="Int32"></asp:Parameter> </DeleteParameters> <InsertParameters> <asp:Parameter Name="JobFunction" Type="String"></asp:Parameter> <asp:Parameter Name="Description" Type="String"></asp:Parameter> <asp:Parameter Name="Profile1" Type="String"></asp:Parameter> <asp:Parameter Name="Profile2" Type="String"></asp:Parameter> </InsertParameters> <UpdateParameters> <asp:Parameter Name="JobFunction" Type="String"></asp:Parameter> <asp:Parameter Name="Description" Type="String"></asp:Parameter> <asp:Parameter Name="Profile1" Type="String"></asp:Parameter> <asp:Parameter Name="Profile2" Type="String"></asp:Parameter> <asp:Parameter Name="JobFunctionIndex" Type="Int32"></asp:Parameter> </UpdateParameters> </asp:SqlDataSource> </div></asp:Panel><asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString='<%$ ConnectionStrings:SiteSqlServer %>' DeleteCommand="DELETE FROM [Bak-Employee] WHERE [EmployeeIndex] = @EmployeeIndex" InsertCommand="INSERT INTO [Bak-Employee] ([NameFirst], [NameMiddle], [JobFunction]) VALUES (@NameFirst, @NameMiddle, @JobFunction)" SelectCommand="SELECT [EmployeeIndex], [NameFirst], [NameMiddle], [JobFunction] FROM [Bak-Employee] WHERE ([JobFunction] = @JobFunction)" UpdateCommand="UPDATE [Bak-Employee] SET [NameFirst] = @NameFirst, [NameMiddle] = @NameMiddle, [JobFunction] = @JobFunction WHERE [EmployeeIndex] = @EmployeeIndex"> <DeleteParameters> <asp:Parameter Name="EmployeeIndex" Type="Int32"></asp:Parameter> </DeleteParameters> <InsertParameters> <asp:Parameter Name="NameFirst" Type="String"></asp:Parameter> <asp:Parameter Name="NameMiddle" Type="String"></asp:Parameter> <asp:Parameter Name="JobFunction" Type="String"></asp:Parameter> </InsertParameters> <SelectParameters> <asp:SessionParameter SessionField="JobFunction" DefaultValue="JobFunction" Name="JobFunction" Type="String"></asp:SessionParameter> </SelectParameters> <UpdateParameters> <asp:Parameter Name="NameFirst" Type="String"></asp:Parameter> <asp:Parameter Name="NameMiddle" Type="String"></asp:Parameter> <asp:Parameter Name="JobFunction" Type="String"></asp:Parameter> <asp:Parameter Name="EmployeeIndex" Type="Int32"></asp:Parameter> </UpdateParameters></asp:SqlDataSource>