/* Gride event to edit the row * check to this event is that duplicate Service Name . otherwise update service */ protected void gdvAdditionalServices_RowUpdating(object sender, GridViewUpdateEventArgs e) { GridViewRow row = gdvAdditionalServices.Rows[e.RowIndex]; if (row != null) { AdditionalServiceID = Convert.ToInt32(gdvAdditionalServices.DataKeys[e.RowIndex].Value); Label lblServiceName = (Label)gdvAdditionalServices.Rows[e.RowIndex].FindControl("lblServiceName"); TextBox txtServiceName = (TextBox)gdvAdditionalServices.Rows[e.RowIndex].FindControl("txtServiceName"); if (txtServiceName.Text == "") { MessageBox("Please enter Service name."); } else { StoreFront ObjStoreFront = new StoreFront(); int Count = ObjStoreFront.UpdateAdditionalServices(AdditionalServiceID, txtServiceName.Text.Trim()); if (Count == 1) { SuccesfullMessage("Service updated successfully."); gdvAdditionalServices.EditIndex = -1; BindGrid(); } else { SuccesfullMessage("Duplicate additional service."); gdvAdditionalServices.EditIndex = -1; BindGrid(); } } } }