Click here to Skip to main content
15,910,980 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a gridview in which i have two text boxes and one button ,when user click on button a new row with two textboxes is added, i want to use text change event in 1st textbox, and at the end pass a value to 2nd text box,problem is that ,value does not show up in the textbox
C#
protected void txtCode_TextChanged(object sender, EventArgs e)
       {
          GridViewRow currentRow =(GridViewRow)((TextBox)sender).Parent.Parent;
          TextBox txt = (TextBox)currentRow.FindControl("txtCode");
          TextBox txtfine = (TextBox)currentRow.FindControl("txtFine");
             Int32 count =Convert.ToInt32( txt.Text);
               var chkradio = rblQualification.SelectedValue;
               byte chkRadio = SafeConvert.ToByte(chkradio);
               var vehiclecategory = _service.GetAllVehicleCategory().Where(x => x.ID == chkRadio).FirstOrDefault();
               var vehicletype = vehiclecategory.VehicleType_Id;
               var pntytype = _service.GetAllVehiclePenaltyType().Where(x => x.ID == SafeConvert.ToByte(count)).Count();
               var plntyfee = _service.GetAllVehiclePenaltiesFee().Where(x => x.VehicleTypeID == vehicletype && x.VehiclePenaltyTypeID == vehicletype).FirstOrDefault();
            txtfine.Text = plntyfee.Fee.ToString();

       }
Posted
Comments
Sinisa Hajnal 28-Sep-15 5:55am    
Did you try stepping through the code? What is the value of pnltyfee.Fee?
Sajid227 28-Sep-15 6:01am    
its valaue exact when is in db,problem is at the end of event when go control back browser,it does not show any value

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900