Add New Record button is not showing

2 posts, 0 answers
  1. Kumaran
    Kumaran avatar
    6 posts
    Member since:
    Jan 2014

    Posted 29 Jul Link to this post

    Hi,

    I have a RadGrid inside a AjaxPanel. On View Click, am hiding the grid and showing another div. I have back button inside that div and on click of that, am showing the grid back. But when showing the grid, the add new record is not showing up. Tried setting the ShowAddNewRecordButton to true while changing the visibility of the grid. Still it is not showing up. Any pointers why is the add record button is not showing ?

    <div id="div1">
    <asp:Button ID="BackButton" Text="Back"runat="server" OnClick="BackButton_Click" />
    </div>

    <div id="div2">
    <telerik:RadGrid ID="Grid"
            runat="server"
            AllowSorting="True"
            AllowPaging="True"
            ShowFooter="True"
            ShowStatusBar="True"
            AutoGenerateColumns="False"
            AllowAutomaticDeletes="True"
            AllowAutomaticInserts="True"
            AllowAutomaticUpdates="True"
            OnInsertCommand="Grid_CreateCommand"
            OnUpdateCommand="Grid_UpdateCommand"
            OnNeedDataSource="Grid_NeedDataSource"
            OnItemDataBound="Grid_ItemDataBound"
            OnItemCreated="Grid_ItemCreated"
            OnItemCommand="Grid_ItemCommand" >
            <MasterTableView EditMode="EditForms" DataKeyNames="RecordID" CommandItemDisplay="Top">
               <Columns>
                   <telerik:GridButtonColumn ButtonType="LinkButton" Text="View" CommandName="View" UniqueName="View" />
                   <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="Edit" />
                   <telerik:GridBoundColumn UniqueName="Date" HeaderText="Date" DataField="Date" DataFormatString="{0:MM/dd/yyyy}"/>
                   <telerik:GridBoundColumn UniqueName="Type" HeaderText="Code" DataField="Type"/>
                </Columns>
                <CommandItemSettings AddNewRecordText="Add New Record" />
                <EditFormSettings
                    InsertCaption="Add New Record"
                    CaptionFormatString="Edit Record"
                    PopUpSettings-Modal="true"
                    EditFormType="WebUserControl"
                    UserControlName="~/EditDetailUserControl.ascx">
                </EditFormSettings>
            </MasterTableView>
            <ClientSettings>
                <ClientEvents OnCommand="RaiseCommand" />
            </ClientSettings>
        </telerik:RadGrid>
    <div>

    Thanks
  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 03 Aug Link to this post

    Hello,

    I tried to replicate the behavior you describe using the provided code but to no avail. You will find the sample i used for testing attached. Please give it a try and let me know what is different in your scenario.

    I would appreciate it if you can tell what should be modified in the code in order to replicate the behavior you are observing.

    Regards,
    Viktor Tachev
    Telerik by Progress
    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