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

Using PerformInsert on grid

2 Answers 157 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Matt asked on 11 Jul 2011, 07:36 PM
Hi All, I am using the Demo code for using the automatic editing features of the grid, but regardless of if I "edit" a record or "Insert" a record, only the "Update" ever shows, "Insert" Button never does. Using the following code:
Q1 2011
RadGrid settings
           AllowAutomaticInserts="true" 
           AllowAutomaticUpdates="true" 
           AllowAutomaticDeletes="true"  
    
    
Command buttons:  "Insert" Button never shows. 
    <td colspan="99"
        <asp:Button 
            ID="btnUpdate" 
            Text="Update" 
            runat="server" 
            CommandName="Update" 
            Visible='<%# !(Container is Telerik.Web.UI.GridInsertionObject) %>'> 
        </asp:Button
        <asp:Button 
            ID="btnInsert" 
            Text="Insert" 
            runat="server" 
            CommandName="PerformInsert"
            Visible='<%# Container is Telerik.Web.UI.GridInsertionObject %>'> 
        </asp:Button
Thanks,

Matt


2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 12 Jul 2011, 06:48 AM
Hello Matt,

Try setting the visibility as shown below.

aspx:
<asp:Button ID="btnUpdate" Text="Update" runat="server" CommandName="Update"
          Visible='<%# !(Container is Telerik.Web.UI.GridEditFormInsertItem) %>'>
</asp:Button>
<asp:Button ID="btnInsert" Text="Insert"  runat="server" CommandName="PerformInsert"
          Visible='<%# Container is Telerik.Web.UI.GridEditFormInsertItem %>'>
</asp:Button>

Thanks,
Princy.
0
Matt
Top achievements
Rank 1
answered on 12 Jul 2011, 07:57 PM
Thank you, Princy!  That fixed it!

Tags
Grid
Asked by
Matt
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Matt
Top achievements
Rank 1
Share this question
or