MS GridControl bei ReadOnly Editable = false

This commit is contained in:
Developer01 2024-09-12 15:01:35 +02:00
parent 3b064662d6
commit 5be782333d
3 changed files with 31 additions and 23 deletions

View File

@ -482,6 +482,7 @@ Public Class ClassControlCreator
Dim oControlId = DirectCast(oControl.Tag, ControlMetadata).Guid
Dim oView As GridView
oControl.ForceInitialize()
oView = oControl.MainView
@ -495,7 +496,9 @@ Public Class ClassControlCreator
oView.OptionsBehavior.Editable = Not row.Item("READ_ONLY")
oView.OptionsBehavior.ReadOnly = row.Item("READ_ONLY")
'oView.OptionsBehavior.EditorShowMode = EditorShowMode.Click
If oView.OptionsBehavior.ReadOnly = True Then
oView.OptionsBehavior.Editable = False
End If
oControl.UseEmbeddedNavigator = Not row.Item("READ_ONLY")
oView.OptionsBehavior.EditorShowMode = EditorShowMode.MouseDown
@ -505,16 +508,17 @@ Public Class ClassControlCreator
oView.OptionsSelection.MultiSelect = True
oView.OptionsClipboard.CopyColumnHeaders = DefaultBoolean.False
If row.Item("VKT_ADD_ITEM") = True Then
oView.OptionsBehavior.AllowAddRows = DefaultBoolean.True
oView.OptionsBehavior.AllowDeleteRows = DefaultBoolean.True
oView.OptionsView.NewItemRowPosition = NewItemRowPosition.Bottom
Else
oView.OptionsBehavior.AllowAddRows = DefaultBoolean.False
oView.OptionsBehavior.AllowDeleteRows = DefaultBoolean.False
oView.OptionsView.NewItemRowPosition = NewItemRowPosition.None
If oView.OptionsBehavior.ReadOnly = False Then
If row.Item("VKT_ADD_ITEM") = True Then
oView.OptionsBehavior.AllowAddRows = DefaultBoolean.True
oView.OptionsBehavior.AllowDeleteRows = DefaultBoolean.True
oView.OptionsView.NewItemRowPosition = NewItemRowPosition.Bottom
Else
oView.OptionsBehavior.Editable = False
oView.OptionsView.NewItemRowPosition = NewItemRowPosition.None
End If
End If
End If
oControl.Size = New Size(row.Item("WIDTH"), row.Item("HEIGHT"))

View File

@ -742,8 +742,11 @@ Public Class frmMain
GridViewWorkflows.Columns(oReducedColName).DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss"
Catch ex As Exception
Try
GridViewWorkflows.Columns("Zuletzt bearbeitet").DisplayFormat.FormatType = FormatType.DateTime
GridViewWorkflows.Columns("Zuletzt bearbeitet").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss"
If oReducedColName <> "Zuletzt bearbeitet" Then
GridViewWorkflows.Columns("Zuletzt bearbeitet").DisplayFormat.FormatType = FormatType.DateTime
GridViewWorkflows.Columns("Zuletzt bearbeitet").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss"
End If
Catch ex1 As Exception
LOGGER.Warn($"(ResetLayout)Column [{oReducedColName}] or [Zuletzt bearbeitet] not part of OverviewSQL")
@ -1872,6 +1875,7 @@ Public Class frmMain
LOGGER.Debug($"Adding tag [{GridViewWorkflows.Columns.Item("PROFILE_ID")}] for group...")
Dim sd = GridViewWorkflows.GroupedColumns(index).GetTextCaption
GridViewWorkflows.GroupedColumns(index).Tag = GridViewWorkflows.Columns.Item("PROFILE_ID")
Next
GridViewWorkflows.CollapseAllGroups()
LOGGER.Debug("finished Grouping!")

View File

@ -126,7 +126,7 @@
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="SplitContainerButtons.Location" type="System.Drawing.Point, System.Drawing">
<value>5, 283</value>
<value>5, 331</value>
</data>
<data name="SplitContainerReject_NotResp.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
<value>Fill</value>
@ -477,7 +477,7 @@
<value>2, 2</value>
</data>
<data name="PanelValidatorControl.Size" type="System.Drawing.Size, System.Drawing">
<value>428, 190</value>
<value>428, 238</value>
</data>
<data name="PanelValidatorControl.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
@ -498,7 +498,7 @@
<value>5, 85</value>
</data>
<data name="PanelValidatorControlBorder.Size" type="System.Drawing.Size, System.Drawing">
<value>432, 194</value>
<value>432, 242</value>
</data>
<data name="PanelValidatorControlBorder.TabIndex" type="System.Int32, mscorlib">
<value>44</value>
@ -589,7 +589,7 @@
<value>0, 0</value>
</data>
<data name="PanelControl1.Size" type="System.Drawing.Size, System.Drawing">
<value>442, 344</value>
<value>442, 392</value>
</data>
<data name="PanelControl1.TabIndex" type="System.Int32, mscorlib">
<value>25</value>
@ -628,7 +628,7 @@
<value>3, 4, 3, 4</value>
</data>
<data name="DocumentViewerValidator.Size" type="System.Drawing.Size, System.Drawing">
<value>347, 344</value>
<value>347, 392</value>
</data>
<data name="DocumentViewerValidator.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
@ -658,7 +658,7 @@
<value>1</value>
</data>
<data name="SplitContainer1.Size" type="System.Drawing.Size, System.Drawing">
<value>793, 344</value>
<value>793, 392</value>
</data>
<data name="SplitContainer1.SplitterDistance" type="System.Int32, mscorlib">
<value>442</value>
@ -709,7 +709,7 @@
<value>Bottom</value>
</data>
<data name="barDockControlBottom.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 524</value>
<value>0, 572</value>
</data>
<data name="barDockControlBottom.Size" type="System.Drawing.Size, System.Drawing">
<value>793, 0</value>
@ -733,7 +733,7 @@
<value>0, 0</value>
</data>
<data name="barDockControlLeft.Size" type="System.Drawing.Size, System.Drawing">
<value>0, 524</value>
<value>0, 572</value>
</data>
<data name="&gt;&gt;barDockControlLeft.Name" xml:space="preserve">
<value>barDockControlLeft</value>
@ -754,7 +754,7 @@
<value>793, 0</value>
</data>
<data name="barDockControlRight.Size" type="System.Drawing.Size, System.Drawing">
<value>0, 524</value>
<value>0, 572</value>
</data>
<data name="&gt;&gt;barDockControlRight.Name" xml:space="preserve">
<value>barDockControlRight</value>
@ -778,7 +778,7 @@
<value>7, 17</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>793, 524</value>
<value>793, 572</value>
</data>
<data name="bsiError.ItemAppearance.Normal.Font" type="System.Drawing.Font, System.Drawing">
<value>Tahoma, 8.25pt, style=Bold</value>
@ -1315,7 +1315,7 @@
<value>793, 158</value>
</data>
<data name="RibbonStatusBar1.Location" type="System.Drawing.Point, System.Drawing">
<value>0, 502</value>
<value>0, 550</value>
</data>
<data name="RibbonStatusBar1.Size" type="System.Drawing.Size, System.Drawing">
<value>793, 22</value>