private void ViewChannel_ValueChanged(object sender, EventArgs e) { int index = ViewChannels.IndexOf(sender as ViewChannel); (dgDrawChannels.DataSource as BindingSource).ResetItem(index); CellValueChanged?.Invoke(this, new DataGridViewCellEventArgs(0, index)); }
private void ViewChannel_ColorChanged(object sender, EventArgs e) { ViewChannel item = sender as ViewChannel; int index = ViewChannels.IndexOf(item); dgDrawChannels[1, index].Style.BackColor = item.Color; dgDrawChannels[1, index].Style.SelectionBackColor = item.Color; (dgDrawChannels.DataSource as BindingSource).ResetItem(index); }