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

[Solved] Update/Edit Events do not fire

3 Answers 163 Views
Grid
This is a migrated thread and some comments may be shown as answers.
John G
Top achievements
Rank 1
John G asked on 10 Jan 2008, 04:16 AM
I have two ObjectDataSource that return collections.  I can successfully bind them to a radGrid as a parent and child.  Everything works to view.  I can expand child relationships for all rows in the parent table. I can edit, and delete records for the parent table.  However I cannot edit or delete records in the child tables.  If I put breakpoints in the code for the edit and update methods in the business object helper class the methods are never called.  No exceptions are thrown.  I did assign the DataSourceId to the ObjectDataSource in the property editor for the child table. I've been stuck for a whole day on this.

ASPX Code

<

body>

<form id="form1" runat="server">

<asp:ScriptManager ID="ScriptManager1" runat="server">

</asp:ScriptManager>

<div>

<telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"

AllowAutomaticUpdates="True" AutoGenerateColumns="False" AutoGenerateDeleteColumn="True"

AutoGenerateEditColumn="True" DataSourceID="ObjectDataSource_MenuCategories"

GridLines="None">

<GroupPanel ID="GroupPanel" Style="width: 100%;">

</GroupPanel>

<ExportSettings>

<Pdf FontType="Subset" PaperSize="Letter" />

<Excel Format="Html" />

</ExportSettings>

<ClientSettings>

<Selecting AllowRowSelect="True" />

</ClientSettings>

<MasterTableView CommandItemDisplay="TopAndBottom" CurrentResetPageIndexAction="SetPageIndexToFirst"

DataKeyNames="CategoryId" DataSourceID="ObjectDataSource_MenuCategories" Dir="LTR"

Frame="Border" TableLayout="Auto">

<EditFormSettings>

<EditColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType">

</EditColumn>

</EditFormSettings>

<Columns>

<telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="Name" FilterListOptions="VaryByDataType"

ForceExtractValue="None" HeaderText="Name" SortExpression="Name" UniqueName="Name">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="SubHeading"

FilterListOptions="VaryByDataType" ForceExtractValue="None" HeaderText="SubHeading"

SortExpression="SubHeading" UniqueName="SubHeading">

</telerik:GridBoundColumn>

</Columns>

<ExpandCollapseColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"

Resizable="False">

<HeaderStyle Width="20px" />

</ExpandCollapseColumn>

<DetailTables>

<telerik:GridTableView runat="server" CommandItemDisplay="Top" CurrentResetPageIndexAction="SetPageIndexToFirst"

DataKeyNames="ItemId" DataSourceID="ObjectDataSource_MenuItems" Dir="LTR" Frame="Border"

TableLayout="Auto">

<EditFormSettings>

<EditColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType">

</EditColumn>

</EditFormSettings>

<ParentTableRelation>

<telerik:GridRelationFields DetailKeyField="CategoryId" MasterKeyField="CategoryId" />

</ParentTableRelation>

<Columns>

<telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="Name" FilterListOptions="VaryByDataType"

ForceExtractValue="None" HeaderText="Item" SortExpression="Item" UniqueName="Name">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="Price" FilterListOptions="VaryByDataType"

ForceExtractValue="None" HeaderText="Price" SortExpression="Price" UniqueName="Price">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="SubHeading"

FilterListOptions="VaryByDataType" ForceExtractValue="None" HeaderText="Description"

SortExpression="Description" UniqueName="SubHeading">

</telerik:GridBoundColumn>

</Columns>

<ExpandCollapseColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"

Resizable="False" Visible="False">

<HeaderStyle Width="20px" />

</ExpandCollapseColumn>

<RowIndicatorColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"

Visible="False">

<HeaderStyle Width="20px" />

</RowIndicatorColumn>

</telerik:GridTableView>

</DetailTables>

<RowIndicatorColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"

Visible="False">

<HeaderStyle Width="20px" />

</RowIndicatorColumn>

</MasterTableView>

</telerik:RadGrid><br />

<asp:ObjectDataSource ID="ObjectDataSource_MenuCategories" runat="server" DeleteMethod="DeleteMenuCategory"

InsertMethod="InsertMenuCategory"

SelectMethod="GetAllMenuCategories" TypeName="LuckyOyster.MenuCategory" UpdateMethod="UpdateMenuCategory" >

<DeleteParameters>

<asp:Parameter Name="CategoryId" Type="Int32" />

</DeleteParameters>

<UpdateParameters>

<asp:Parameter Name="CategoryId" Type="Int32" />

<asp:Parameter Name="Name" Type="String" />

<asp:Parameter Name="SubHeading" Type="String" />

<asp:Parameter Name="Disabled" Type="Boolean" />

</UpdateParameters>

<InsertParameters>

<asp:Parameter Name="CategoryId" Type="Int32" />

<asp:Parameter Name="Name" Type="String" />

<asp:Parameter Name="SubHeading" Type="String" />

<asp:Parameter Name="Disabled" Type="Boolean" />

</InsertParameters>

</asp:ObjectDataSource>

&nbsp;</div>

<asp:ObjectDataSource ID="ObjectDataSource_MenuItems" runat="server" DeleteMethod="DeleteMenuItem"

InsertMethod="InsertMenuItem" SelectMethod="GetAllMenuItemsByCategoryID"

TypeName="LuckyOyster.MenuItem" UpdateMethod="UpdateMenuItem">

<DeleteParameters>

<asp:Parameter Name="ItemID" Type="Int32" />

</DeleteParameters>

<UpdateParameters>

<asp:Parameter Name="ItemID" Type="Int32" />

<asp:Parameter Name="CategoryId" Type="Int32" />

<asp:Parameter Name="Name" Type="String" />

<asp:Parameter Name="SubHeading" Type="String" />

<asp:Parameter Name="Price" Type="Decimal" />

<asp:Parameter Name="Disabled" Type="Boolean" />

</UpdateParameters>

<SelectParameters>

<asp:Parameter Name="CategoryId" Type="Int32" />

</SelectParameters>

<InsertParameters>

<asp:Parameter Name="ItemID" Type="Int32" />

<asp:Parameter Name="CategoryId" Type="Int32" />

<asp:Parameter Name="Name" Type="String" />

<asp:Parameter Name="SubHeading" Type="String" />

<asp:Parameter Name="Price" Type="Decimal" />

<asp:Parameter Name="Disabled" Type="Boolean" />

</InsertParameters>

</asp:ObjectDataSource>

</form>

</

body>

3 Answers, 1 is accepted

Sort by
0
Yavor
Telerik team
answered on 14 Jan 2008, 08:04 AM
Hello J,

Based on the information supplied, I suspect that this may be a validation problem. Are there any validation controls on the page? If this is the case, you can temporarily disable them to see if they are not responsible for this behavior. sometimes in similar scenarios, if the page validation fails, the commands are not raised. If the issue persists, you can open a formal support ticket, and send us a small project sample, demonstrating the case.

Greetings,
Yavor
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Nimesh
Top achievements
Rank 1
answered on 05 Jun 2008, 04:26 AM
Did you ever get this problem resolved? I have been stuck for a whole day on this as well. Any help would be great. Thanks in advance.
0
John G
Top achievements
Rank 1
answered on 05 Jun 2008, 05:08 AM
No, I ended up doing something different.
Tags
Grid
Asked by
John G
Top achievements
Rank 1
Answers by
Yavor
Telerik team
Nimesh
Top achievements
Rank 1
John G
Top achievements
Rank 1
Share this question
or