Radgrid Update command not getting triggered

2 posts, 0 answers
  1. Khadeer
    Khadeer avatar
    12 posts
    Member since:
    Dec 2007

    Posted 06 Apr Link to this post

    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

  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 08 Apr Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top