ArgusTV.Recorder.MediaPortalTvServer.SetupForm._uncPathsDataGridView_CellFormatting C# (CSharp) Method

_uncPathsDataGridView_CellFormatting() private method

private _uncPathsDataGridView_CellFormatting ( object sender, System.Windows.Forms.DataGridViewCellFormattingEventArgs e ) : void
sender object
e System.Windows.Forms.DataGridViewCellFormattingEventArgs
return void
        private void _uncPathsDataGridView_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
        {
            DataGridView dataGridView = sender as DataGridView;
            if (e.ColumnIndex == 1
                && e.RowIndex >= 0
                && e.RowIndex < _uncPathsBindingSource.Count)
            {
                UncPathItem linkItem = dataGridView.Rows[e.RowIndex].DataBoundItem as UncPathItem;
                if (linkItem != null
                    && linkItem.HasError)
                {
                    e.CellStyle.ForeColor = Color.Red;
                    e.CellStyle.SelectionForeColor = Color.Red;
                }
                else
                {
                    e.CellStyle.ForeColor = Color.DarkGreen;
                    e.CellStyle.SelectionForeColor = Color.DarkGreen;
                }
            }
        }