private void ClearItem()
 {
     _Documents = new Dictionary <string, byte[]>();
     _Item      = null;
     ClearSupplier();
     lbDate.Text           = "";
     lbLedger.Text         = "";
     lbAmount.Text         = "";
     txtPaymentRef.Text    = "";
     lbAccount.Text        = "";
     txtInvoiceNumber.Text = "";
     dtInvoiceDate.Value   = _minDate;
 }
        private void dgItems_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            var senderGrid = (DataGridView)sender;

            if (senderGrid.Columns[e.ColumnIndex] is DataGridViewButtonColumn && e.RowIndex >= 0)
            {
                _Item = senderGrid.Rows[e.RowIndex].DataBoundItem as PastelMaintenanceTransaction;

                if (_Item != null)
                {
                    EditItem();
                }
            }
        }