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

Add New Record button is not showing

1 Answer 231 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Kumaran
Top achievements
Rank 1
Iron
Kumaran asked on 29 Jul 2016, 08:47 AM

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

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 03 Aug 2016, 07:09 AM
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.
Tags
Grid
Asked by
Kumaran
Top achievements
Rank 1
Iron
Answers by
Viktor Tachev
Telerik team
Share this question
or