private void FrmXtraSalaryPostedVoucher_Load(object sender, EventArgs e) { salaryVouchersPresenter.Display(PostedDate.ToShortDateString()); if (gridViewSalaryVoucher.RowCount > 0) { RefNo = gridViewSalaryVoucher.GetRowCellValue(0, "RefNo").ToString(); employeesPresenter.DisplayByMonthDateAndRefNo(PostedDate.ToShortDateString(), RefNo); } if (RefNo == "" || RefNo == null) { btnPostedVoucher.Enabled = false; btnCancelCalc.Enabled = false; } }