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

UpdateCommand not firing with EditFormType=WebUserControl

1 Answer 72 Views
Grid
This is a migrated thread and some comments may be shown as answers.
reguapo
Top achievements
Rank 1
reguapo asked on 20 Mar 2014, 06:07 PM
this is my markup:
01.<telerik:RadGrid ID="rgCustomerContacts" runat="server" AllowPaging="True"
02.                        AllowSorting="True" AutoGenerateColumns="False" ShowStatusBar="true">
03.                        <MasterTableView Width="100%" CommandItemDisplay="Top" DataKeyNames="ContactID" EditMode="PopUp">
04.                            <EditFormSettings>
05.                                <PopUpSettings Width="800px" Modal="true" />
06.                            </EditFormSettings>
07.                            <Columns>
08.                                <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" >
09.                                </telerik:GridEditCommandColumn>
10.                                <telerik:GridBoundColumn UniqueName="FullContactName" HeaderText="Contact Name" DataField="FullContactName">
11.                                </telerik:GridBoundColumn>
12.                                <telerik:GridBoundColumn UniqueName="Email" HeaderText="Email" DataField="Email">
13.                                </telerik:GridBoundColumn>
14.                                <telerik:GridBoundColumn UniqueName="Phone" HeaderText="Phone" DataField="Phone">
15.                                </telerik:GridBoundColumn>
16.                                <telerik:GridBoundColumn UniqueName="Fax" HeaderText="Fax" DataField="Fax">
17.                                </telerik:GridBoundColumn>
18.                                <telerik:GridBoundColumn UniqueName="Title" HeaderText="Title" DataField="Title">
19.                                </telerik:GridBoundColumn>
20.                                <telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Delete" CommandName="Delete">
21.                                </telerik:GridButtonColumn>
22.                            </Columns>
23.                            <EditFormSettings UserControlName="~/WebControls/ContactUserControl.ascx" EditFormType="WebUserControl">
24.                                <EditColumn UniqueName="EditCommandColumn1">
25.                                </EditColumn>
26.                            </EditFormSettings>
27.                        </MasterTableView>
28.                        <%--<ClientSettings>
29.                            <ClientEvents OnRowDblClick="RowDblClick"></ClientEvents>
30.                        </ClientSettings>--%>
31.                    </telerik:RadGrid>
 and here is my code behind:
01.Private Sub rgCustomerContacts_OnNeedDataSource(ByVal sender As Object, ByVal e As GridNeedDataSourceEventArgs) Handles rgCustomerContacts.NeedDataSource
02.        If RadTabStripAccount.SelectedTab.PageViewID = "PVContacts" Then
03.                Dim contactList As List(Of SML.Stars.Model.CustomerContact) = CustomerServices.GetCustomerContacts(customerID).ToList()
04.                rgCustomerContacts.DataSource = Mapper.Map(Of List(Of SML.Stars.Model.CustomerContact), List(Of CustomerContactViewModel))(contactList)
05.        End If
06.    End Sub
07. 
08.Private Sub rgCustomerContacts_OnUpdateCommand(ByVal sender As Object, ByVal e As GridCommandEventArgs) Handles rgCustomerContacts.UpdateCommand
09.        Dim contactList As List(Of SML.Stars.Model.CustomerContact) = CustomerServices.GetCustomerContacts(customerID).ToList()
10.    End Sub
11. 
12.Protected Sub RadTabStripAccount_TabClick(ByVal sender As System.Object, ByVal e As RadTabStripEventArgs) Handles RadTabStripAccount.TabClick
13.        Select Case e.Tab.PageViewID
14.            Case "PVAttachments"
15.                ucUploadCustomerDocument.refresh()
16.            Case "PVContacts"
17.                firstTimeLoadContact = True
18.                'RGContacts.Rebind()
19.                rgCustomerContacts.Rebind()
20.        End Select
21.    End Sub

why the UpdateCommand is not firing at all?

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 21 Mar 2014, 06:35 AM
Hi,

Your aspx page looks fine to me. Can you make sure you have set the CommandName="Update" for the Update Button in WebUserControl page. If this doesn't help, provide your ascx page as well.

ASCX:
<asp:Button ID="btnUpdate" Text="Update" runat="server"CommandName="Update"  ../>

Please have a look at this online demo on Grid - Edit Form Types for more information.

Thanks,
Shinu
Tags
Grid
Asked by
reguapo
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or