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

Radgrid Update command not getting triggered

1 Answer 74 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Khadeer
Top achievements
Rank 1
Khadeer asked on 06 Apr 2016, 09:36 AM

Radgrid update command is not getting triggered. During Update ItemCommand Event is also not getting triggered.

Below is the code,

 

<telerik:RadGrid ID="rgdUsers" runat="server" AllowPaging="True" ShowFooter="false"
                AllowSorting="True" AutoGenerateColumns="False" ShowStatusBar="false"
                OnNeedDataSource="rgdUsers_NeedDataSource" AllowFilteringByColumn="true" EnableLinqExpressions="false" Width="100%"
                OnItemCommand="rgdUsers_ItemCommand" OnUpdateCommand="rgdUsers_UpdateCommand">
                <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                <GroupingSettings CaseSensitive="false" />
                <MasterTableView CommandItemDisplay="Top" DataKeyNames="UserId">
                    <Columns>

<Columns>

 <EditFormSettings EditFormType="Template">
                        <FormTemplate>
                            <table width="200px" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td>Name
                                    </td>
                                    <td>
                                        <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
                                    </td>
                                </tr>
                                <tr>
                                    <td align="right" colspan="2">
                                        <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                            runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>' CausesValidation="false"></asp:Button>&nbsp;
                                    <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                                        CommandName="Cancel"></asp:Button>
                                    </td>
                                </tr>
                            </table>

                        </FormTemplate>

                    </EditFormSettings>

                </MasterTableView>
                <%--<ClientSettings>
                <ClientEvents OnRowDblClick="RowDblClick" OnPopUpShowing="onPopUpShowing" />
            </ClientSettings>--%>
            </telerik:RadGrid>

 

protected void rgdUsers_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {

        }

        protected void rgdUsers_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {

        }

 

Can someone help me to know where did I go wrong

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 08 Apr 2016, 10:31 AM
Hello Khadeer,

I examined the provided code and noticed that the markup is not valid. The Columns tag does not have a closing tag. There are two opening tags instead. Ensure that the markup for the grid is valid.

Also the AutoGenerateColumns property is set to false, but there are no columns defined. Please define the columns in the markup or set the property to true.

Let me know how the behavior changes after applying the above modifications.

Regards,
Viktor Tachev
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Tags
Grid
Asked by
Khadeer
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or