Index: ActiviteitenOpvolging/ActiviteitenOpvolging/grids/DataGridViewUserControl.vb =================================================================== diff -u -r1690 -r1691 --- ActiviteitenOpvolging/ActiviteitenOpvolging/grids/DataGridViewUserControl.vb (.../DataGridViewUserControl.vb) (revision 1690) +++ ActiviteitenOpvolging/ActiviteitenOpvolging/grids/DataGridViewUserControl.vb (.../DataGridViewUserControl.vb) (revision 1691) @@ -38,8 +38,6 @@ 'Set label. GridLabel.Text = ConfigsLoader.GridLabelNames(_gridNumber) - 'Set properties of datagrid view. - WorkItemsDataGridView.AutoGenerateColumns = False 'Update headers and visibility of static columns. UpdateStaticColumns() @@ -57,6 +55,28 @@ 'Update enable status of cells and columns. UpdateEnableStatus(workItems) + + 'Set properties of datagrid view. Done here because extra columns get generated. + + WorkItemsDataGridView.AutoGenerateColumns = False + 'Disable resizing of rows and columns. + WorkItemsDataGridView.AllowUserToResizeColumns = False + WorkItemsDataGridView.AllowUserToResizeRows = False + 'Center all cells. + WorkItemsDataGridView.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter + 'Make columns fill space -> removes horizontal scrollbar. + WorkItemsDataGridView.AutoSizeColumnsMode = DataGridViewAutoSizeColumnsMode.Fill + 'Remove empty row at the bottom. + WorkItemsDataGridView.AllowUserToAddRows = False + 'Hide the selectors in front of a row. + WorkItemsDataGridView.RowHeadersVisible = False + For Each column In WorkItemsDataGridView.Columns + 'Disable sort mode for every header. + column.SortMode = DataGridViewColumnSortMode.NotSortable + 'Make every cell not editable. + column.ReadOnly = True + Next + Catch ex As Exception MessageBox.Show($"Could not load {Me.Name}.{vbNewLine}{ex.Message}", "An error occured...", MessageBoxButtons.OK, MessageBoxIcon.Error) End Try @@ -130,7 +150,7 @@ 'Load normal parameters. Dim data As New List(Of String) From { workItem.BatchVisual, - workItem.EndTimeStamp, + workItem.EndTimeStamp.ToString("d MMM HH:mm"), workItem.ProductGroup, workItem.DeliverToResource, workItem.Remark @@ -175,7 +195,6 @@ End If 'If the StartBefore, StartAlmost and Start timestamps are not present in any of the activities, no colors are used. - if workItem.Activities.All() End Sub