protected void rbtPaymentType_SelectedIndexChanged(object sender, EventArgs e) { GridViewRow gvr = (GridViewRow)((RadioButtonList)sender).Parent.Parent; RadioButtonList rbtPaymentType = gvr.FindControl("rbtPaymentType") as RadioButtonList; Label lblPaymentType = gvr.FindControl("lblPaymentType") as Label; //FileUpload fuTestReport = gvr.FindControl("fuTestReport") as FileUpload; CheckBoxList ChkListTest = gvr.FindControl("ChkListTest") as CheckBoxList; ChkListTest.Focus(); lblPaymentType.Visible = false; }
protected void txtSymptoms_TextChanged(object sender, EventArgs e) { GridViewRow gvr = (GridViewRow)((TextBox)sender).Parent.Parent; Label lblsymptoms = gvr.FindControl("lblsymptoms") as Label; TextBox txtsymptoms = gvr.FindControl("txtsymptoms") as TextBox; CheckBoxList ddldiseases = gvr.FindControl("ddldiseases") as CheckBoxList; string symptoms = "^[a-za-z0-9,. ]*$"; if (Regex.IsMatch(txtsymptoms.Text, symptoms)) { lblsymptoms.Visible = false; ddldiseases.Focus(); } else { lblsymptoms.Visible = true; lblsymptoms.Text = "please enter symtoms"; txtsymptoms.Text = ""; txtsymptoms.Focus(); } }