Chriz L

Chriz L

  • NA
  • 220
  • 51.1k

Gridview - Update field while being on row edit mode

Feb 28 2019 2:17 AM
Hello,
 
I need some help with the GridView, you can find the html code below.
On edit mode, when ddlType changes I need lblAvg updated with the proper value (from ddlType) while keeping the row on edit mode.
Similarly, I have to do the same on new addition (insert).
 
Any kind of help will be highly appreciated. 
 
  1. "gv" runat="server" AutoGenerateColumns="false" ShowFooter="true" Font-Size="Small"  
  2.           AllowPaging="True" PageSize="20">  
  3.               
  4.                 "20px"  HeaderText = "ID" Visible="false">  
  5.                       
  6.                         "lblID" runat="server" Text='<%# Eval("ID")%>'>  
  7.                       
  8.                       
  9.                           "txtID" runat="server" Text='<%# Eval("ID")%>'>  
  10.                       
  11.                   
  12.                 "300px"  HeaderText = "Type">  
  13.                       
  14.                         "lblType" runat="server" Width="250px" Text='<%# Eval("TypeDescription")%>'>  
  15.                       
  16.                       
  17.                         "ddlType" Width="250px" runat="server">                    
  18.                       
  19.                       
  20.                         "addDdlType" Width="250px" runat="server">   
  21.                       
  22.                     
  23.                 "150px"  HeaderText = "Average">  
  24.                       
  25.                         "lblAvg" runat="server" Text='<%# Eval("Avg")%>'>  
  26.                       
  27.                   
  28.                 "150px"  HeaderText = "Percentage">  
  29.                       
  30.                         "lblPerc"   runat="server" Text='<%# Eval("Perc")%>'>  
  31.                       
  32.                       
  33.                         "txtPerc" runat="server" Width="100px" Text='<%# Eval("Perc")%>'>  
  34.                       
  35.                       
  36.                         "addtxtPerc" Width="100px" runat="server">  
  37.                       
  38.                   
  39.                 "150" >  
  40.                      
  41.                        "btnEdit" Text="Edit" runat="server" CommandName="Edit"/>                        
  42.                      
  43.                      
  44.                        "btnUpdate" Text="Update" runat="server" CommandName="Update"/>  
  45.                        "btnCancel" Text="Cancel" runat="server" CommandName="Cancel"/>  
  46.                      
  47.                        
  48.                        "btnInsert" runat="server" Text="Insert" Width="100" CommandName="Insert" />  
  49.                      
  50.                  
  51.                   
  52.                       
  53.                       "return confirm('Delete?')">  
  54.                          "btnDelete" runat="server" ImageUrl="~\Images\delete.png" OnClick="Delete" CommandArgument='<%#Eval("ID")%>' />  
  55.                         
  56.                       
  57.                   
  58.               
  59.           
 

Answers (2)