((System.Data.DataTable)dgvClientData.DataSource).Select("Mode=true");
<pre>private void toolStripComboBox1_DropDownClosed(object sender, EventArgs e) { IEnumerable<System.Data.DataRow> UpdatedRecords; string selectedResult = (toolStripComboBox2.Items[toolStripComboBox2.SelectedIndex].ToString()); if (selectedResult == "Both") selectedResult = string.Join(", ", _arr.ToArray()); context.Close(); if ((this.dgvClientData.SelectedRows.Count > 0) && (!dgvClientData.CurrentRow.IsNewRow)) { DialogResult dar = MessageBox.Show("Are you sure you want to assign ClientID: " + selectedResult + " to selected Client IDs? ", "Confirm update", MessageBoxButtons.YesNo, MessageBoxIcon.Question); if (dar == DialogResult.Yes) { foreach (DataGridViewRow dr in this.dgvClientData.SelectedRows) { (dr.Cells["Mode"] as DataGridViewCheckBoxCell).Value = CheckState.Checked; dr.DefaultCellStyle.BackColor = Color.DarkGray; } UpdatedRecords = ((System.Data.DataTable)dgvClientData.DataSource).Select("Mode=true"); UpdateDestination(); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)