private void btnDelete_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e)
 {
     try
     {
         var dlgResult = XtraMessageBox.Show("Are you sure want to delete?", "Confirmation!", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning);
         if (Convert.ToString(dlgResult) == "OK" && gvSubCategory.FocusedRowHandle >= 0)
         {
             ObjSubCategory = new SubCategory();
             ObjSubCategory.SUBCATEGORYID = gvSubCategory.GetFocusedRowCellValue("SUBCATEGORYID");
             ObjSubCategory.UserID        = Utility.UserID;
             objMasterRep.DeleteSubCategory(ObjSubCategory);
             gvSubCategory.DeleteRow(gvSubCategory.FocusedRowHandle);
         }
     }
     catch (Exception ex)
     {
         ErrorMgmt.ShowError(ex);
         ErrorMgmt.Errorlog.Error(ex);
     }
 }