private void _channelsDataGridView_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e) { if (e.ColumnIndex == 1 && e.RowIndex >= 0 && e.RowIndex < _channelItemsBindingSource.Count) { LinkedChannelItem linkItem = _channelsDataGridView.Rows[e.RowIndex].DataBoundItem as LinkedChannelItem; if (linkItem != null) { e.CellStyle.ForeColor = linkItem.RowColor; e.CellStyle.SelectionForeColor = linkItem.RowColor; } } }