Accord.Controls.Extensions.dataGridView1_CellFormatting C# (CSharp) Метод

dataGridView1_CellFormatting() приватный статический Метод

private static dataGridView1_CellFormatting ( object sender, System.Windows.Forms.DataGridViewCellFormattingEventArgs e ) : void
sender object
e System.Windows.Forms.DataGridViewCellFormattingEventArgs
Результат void
        private static void dataGridView1_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
        {
            // http://www.developer-corner.com/2007/07/datagridview-how-to-bind-nested-objects_18.html

            DataGridView dataGridView1 = sender as DataGridView;

            var row = dataGridView1.Rows[e.RowIndex];
            var col = dataGridView1.Columns[e.ColumnIndex];

            if ((row.DataBoundItem != null) && (col.DataPropertyName.Contains(".")))
            {
                e.Value = BindProperty(row.DataBoundItem, col.DataPropertyName,
                    col.DefaultCellStyle.Format, col.DefaultCellStyle.FormatProvider);
            }
        }