public void SetData(IList <T> data, string description = null) { //_Grid.CurrentCellChanged -= _Grid_CurrentCellChanged; //_Grid.SelectionChanged -= _Grid_SelectionChanged; try { _Data = new SortableBindingList <T>(data.ToList()); _Grid.DataSource = _Data; //foreach (var row in _Grid.Rows.AsEnumerable()) SetRowColors(row); _Grid.ApplyDisplayFormat(_Data); _Grid.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells); _Label.Text = description; } finally { //_Grid.SelectionChanged += _Grid_SelectionChanged; //_Grid.CurrentCellChanged += _Grid_CurrentCellChanged; } }