private void Load_Activity() { try { if (dgvBatcList.Rows.Count > 0) { DataTable dt = objBatchActivity_DL.GetView_Packing(dgvBatcList.CurrentRow.Cells["BatchNo"].Value.ToString()); objSourceActivityList.DataSource = dt; dgvActivity.AutoGenerateColumns = false; dgvActivity.DataSource = objSourceActivityList; objSourceActivityList.ResetBindings(true); } } catch (Exception) { MessageBox.Show(this, "Error occured while loading Batch List", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } }