Exemplo n.º 1
0
        public void LoadScanItems(DataTable data)
        {
            if (ScanItemsGrid.InvokeRequired)
            {
                var del = new Action(() => LoadScanItems(data));
                ScanItemsGrid.BeginInvoke(del);
            }
            else
            {
                ScanItemsGrid.SuspendLayout();

                var gridState = new GridState(ScanItemsGrid);

                ScanItemsGrid.Populate(data, ScanItemsGridColumns());

                // Bold tag and serial columns.
                ScanItemsGrid.Columns[MunisFixedAssetTable.Asset].DefaultCellStyle.Font = new Font(ScanItemsGrid.Font, FontStyle.Bold);
                ScanItemsGrid.Columns[MunisFixedAssetTable.Asset].HeaderCell.Style.Font = new Font(ScanItemsGrid.Font, FontStyle.Bold);

                ScanItemsGrid.Columns[MunisFixedAssetTable.Serial].DefaultCellStyle.Font = new Font(ScanItemsGrid.Font, FontStyle.Bold);
                ScanItemsGrid.Columns[MunisFixedAssetTable.Serial].HeaderCell.Style.Font = new Font(ScanItemsGrid.Font, FontStyle.Bold);

                ScanItemsGrid.FastAutoSizeColumns();

                gridState.RestoreState();

                SetRowColors();

                ScanItemsGrid.ResumeLayout();

                DisplayDetailsOfSelected();
            }
        }