private void loadCustomerKey() { try { List <CustomerKey> lstCusKey = new List <CustomerKey>(); if (dgvCustomerList.CurrentRow != null) { var cusSelected = (MCustomer)dgvCustomerList.CurrentRow.DataBoundItem; lstCusKey = SQLiteCommon.GetALlKeysByCusId(cusSelected.ID); } BindingDataGridView(dgvCusKeys, lstCusKey); } catch (Exception ex) { log.Error(ex); ShowMsg(MessageBoxIcon.Error, ex.Message); } }