private void dataGridViewSynchronization_DataBindingComplete(object sender, DataGridViewBindingCompleteEventArgs e) { foreach (DataGridViewRow row in dataGridViewSynchronization.Rows) { if (row.Cells["SelectColumn"] != null) { //Check all the checkbox for the NonSyched status row.Cells["SelectColumn"].Value = row.Cells["StatusColumn"]?.Value != null && (StatusEnum)row.Cells["StatusColumn"].Value == StatusEnum.NotSynched; } } OnSynchRebinded?.Invoke(this, e); }
private void btnSynchNow_Click(object sender, EventArgs e) { var batchId = Guid.NewGuid(); foreach (DataGridViewRow row in dataGridViewSynchronization.Rows) { if (row.Visible) { var selectedCell = row.Cells["SelectColumn"]; if ((bool)selectedCell.Value) { SynchRow(row, batchId); } } } CurrentSynchronization.Save(); OnSynchRebinded?.Invoke(this, e); }