arous ahmed

arous ahmed

  • NA
  • 14
  • 1.2k

hide "add" linkbutton when i click to "edit" linkbutton"

Sep 30 2018 9:33 AM
hi ,
this is my site form 
 
 
and when i click to edit link button the add link button visible
 
 
this is my form code 
 
  1.  <asp:TemplateField  HeaderStyle-Width="50px">  
  2.   
  3.     <ItemTemplate>  
  4.  <asp:LinkButton ID="link_edit" runat="server" CommandName="edit" ToolTip="edit" Text="<span class='table-icons'><i class='fas fa-edit'></i></span>" style="width:20px"></asp:LinkButton>  
  5.   
  6.  <asp:LinkButton ID="link_delete" runat="server" CommandName="delete" ToolTip="delete" Text="<span class='table-icons'><i class='fas fa-times'></i></span>" style="width:20px;" OnClientClick="return confirm('Are you sure you want to delete this record?');"></asp:LinkButton>  
  7.   
  8.   </ItemTemplate>  
  9.   
  10.  <EditItemTemplate>  
  11. <asp:LinkButton ID="link_update" runat="server" CommandName="Update" ToolTip="Update" Text="<span class='table-icons'><i class='far fa-save'></i></span>" style="width:20px;"></asp:LinkButton>  
  12.   
  13. <asp:LinkButton ID="link_cancel" runat="server" CommandName="Cancel" ToolTip="cancel" Text="<span class='table-icons'><i class='fas fa-times'></i></span>" style="width:20px;"></asp:LinkButton>  
  14.                                                                               
  15. </EditItemTemplate>  
  16.   
  17.                                                                               
  18. <HeaderTemplate>  
  19.                                                
  20.  <label style="color: #3366FF">Action</label>                                                                                  
  21. <asp:LinkButton ID="link_add" runat="server" ValidationGroup="company_country" CausesValidation="true" CommandName="addnew" ToolTip="addnew" Text="<span class='table-icons' style='font-size:15pt;'><i class='far fa-save'></i></span>"></asp:LinkButton>  
  22.                                                                              
  23.  </HeaderTemplate>  
  24.                                                                          
  25.  </asp:TemplateField>  
 and this is my function that i would define invisible = false 
  1. protected void GridView_cause_RowEditing(object sender, GridViewEditEventArgs e)  
  2.         {  
  3.             GridView_cause.EditIndex = e.NewEditIndex;  
  4.             PARAM_CAUSE_DEPARTURE_DAO cause = new PARAM_CAUSE_DEPARTURE_DAO(this._sSqlConnectionString);  
  5.             display_cause();  
  6.             cause.edit(GridView_cause);  
  7.             display_cause_form();  
  8.         }  
 help me please

Answers (2)