<telerik:RadGrid ID="grdLibraryGlobalRates" runat="server" DataSourceID="dsLibraryGlobalRateManager"
AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True">
<MasterTableView CommandItemDisplay="Top" DataSourceID="dsLibraryGlobalRateManager"
DataKeyNames="_LibraryGlobalRateScheduleID">
<DetailTables>
<telerik:GridTableView Name="grdGlobalRateScheduleEvent"
DataKeyNames="_LibraryGlobalRateScheduleEventID"
DataSourceID="dsLibraryGlobalRateManagerEvent" Width="100%"
runat="server" AutoGenerateColumns="False" CommandItemDisplay="Top">
<ParentTableRelation>
<telerik:GridRelationFields DetailKeyField="_LibraryGlobalRateScheduleID"
MasterKeyField="_LibraryGlobalRateScheduleID"></telerik:GridRelationFields>
</ParentTableRelation>
.............. Columns here
<EditFormSettings EditFormType="WebUserControl"
UserControlName="UserControls_EditUpdate/LibraryGlobalRateEvents.ascx">
<EditColumn FilterControlAltText="Filter EditCommandColumn1 column"
UniqueName="EditCommandColumn1">
</EditColumn>
</EditFormSettings>
</telerik:GridTableView>
</DetailTables>
............Columns here
<EditFormSettings EditFormType="WebUserControl" UserControlName="UserControls_EditUpdate/LibraryGlobalRates.ascx">
<EditColumn FilterControlAltText="Filter EditCommandColumn1 column" UniqueName="EditCommandColumn1">
</EditColumn>
</EditFormSettings>
</MasterTableView>
</telerik:RadGrid>
I have put command names on the update (LibraryGlobalRateEventUpdate) and insert (LibraryGlobalRateEventInsert) buttons on the usercontrol for the details table update. on the main grid item command event I evaluate for the command name and proceed accordingly in the code behind:
Protected Sub grdLibraryGlobalRates_ItemCommand(sender As Object, e As GridCommandEventArgs) Handles grdLibraryGlobalRates.ItemCommand
If e.CommandName = "LibraryGlobalRateEventUpdate" Then
Try
Dim MyUserControl As UserControl = CType(e.Item.FindControl(Telerik.Web.UI.GridEditFormItem.EditFormUserControlID), UserControl)
End If
If e.CommandName = "LibraryGlobalRateEventInsert" Then
Try
Dim MyUserControl As UserControl = CType(e.Item.FindControl(Telerik.Web.UI.GridEditFormItem.EditFormUserControlID), UserControl)
End If
End Sub
On the LibraryGlobalRateEventInsert command, e.item evaluates to
{Telerik.Web.UI.GridEditFormInsertItem} and MyUserControl gets set to the usercontrol I am using for the EditFormSettings
On the LibraryGlobalRateEventUpdate command, e.item evaluates to
{Telerik.Web.UI.GridDataItem} and MyUserControl gets set to Nothing
At this point I am unable to update values when edit is selected.
Please help me resolve this or point me to a post that will explain the update process for details tables as it pertains to UserControls for editing.
Thanks,
Marty