protected void RebindOnDelete(object sender, GridViewDeletedEventArgs e) { // cleanup related record int patientProtocolId = int.Parse(PatientProtocolId); string labTestId = e.Keys[LabTest.LabTestId].ToString(); if (!string.IsNullOrEmpty(labTestId)) { RelatedRecordController.DeleteRelatedRecord(new LabTest().TableName, int.Parse(labTestId), new PatientProtocol().TableLabel, patientProtocolId); } // rebuild interface BuildLabTestsInterface(); }