jj: GridViewProfile
This commit is contained in:
parent
87579d289e
commit
3519d2be6e
1
app/DD_PM_WINDREAM/frmMain.Designer.vb
generated
1
app/DD_PM_WINDREAM/frmMain.Designer.vb
generated
@ -274,7 +274,6 @@ Partial Class frmMain
|
||||
Me.GridViewProfile.GroupPanelText = "Ziehen Sie Spaltenüberschriften in diesen Bereich um nach diesen gruppieren zu la" &
|
||||
"ssen"
|
||||
Me.GridViewProfile.Name = "GridViewProfile"
|
||||
Me.GridViewProfile.OptionsBehavior.AlignGroupSummaryInGroupRow = DevExpress.Utils.DefaultBoolean.[True]
|
||||
Me.GridViewProfile.OptionsBehavior.AllowAddRows = DevExpress.Utils.DefaultBoolean.[False]
|
||||
Me.GridViewProfile.OptionsBehavior.AllowDeleteRows = DevExpress.Utils.DefaultBoolean.[False]
|
||||
Me.GridViewProfile.OptionsBehavior.Editable = False
|
||||
|
||||
@ -125,7 +125,7 @@
|
||||
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
|
||||
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
|
||||
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADw
|
||||
CAAAAk1TRnQBSQFMAgEBAgEAAUABAgFAAQIBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
CAAAAk1TRnQBSQFMAgEBAgEAAVABAgFQAQIBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
|
||||
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
|
||||
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
|
||||
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
|
||||
|
||||
@ -11,6 +11,7 @@ Public Class frmMain
|
||||
Private UserLoggedin As Integer = 0
|
||||
Private PROFILE_COUNT As Integer = 0
|
||||
Private DTPROFIL As DataTable
|
||||
Private DT_VWPM_PROFILE_ACTIVE As DataTable
|
||||
|
||||
Private RedDocuments As Integer = 0
|
||||
Private YellowDocuments As Integer = 0
|
||||
@ -161,6 +162,7 @@ Public Class frmMain
|
||||
Try
|
||||
If Me.Visible = True And frmProfileDesigner.Visible = False Then
|
||||
DTPROFIL = ClassDatabase.Return_Datatable("SELECT * FROM TBPM_PROFILE WHERE GUID = " & CURRENT_ProfilGUID)
|
||||
DT_VWPM_PROFILE_ACTIVE = ClassDatabase.Return_Datatable("SELECT * FROM VWPM_PROFILE_ACTIVE")
|
||||
PROFILE_COUNT = 0
|
||||
Dim sql = CURRENT_DT_CONFIG.Rows(0).Item("SQL_PROFILE_MAIN_VIEW")
|
||||
sql = sql.replace("@USER", Environment.UserName)
|
||||
@ -170,8 +172,8 @@ Public Class frmMain
|
||||
' "WHERE T.PROFIL_ID = T1.PROFIL_ID " &
|
||||
' "AND T1.ACTIVE = 1 And (UPPER(T1.USERNAME) = UPPER('{0}')) Order By T1.PRIORITY", Environment.UserName)
|
||||
Dim DTGRID As DataTable = ClassDatabase.Return_Datatable(sql, True)
|
||||
If Not IsNothing(DTGRID) Then
|
||||
|
||||
If Not IsNothing(DTGRID) Then
|
||||
' Spalte für Status Icon erstellen
|
||||
Dim columnStateIcon As New DataColumn()
|
||||
columnStateIcon.DataType = GetType(Image)
|
||||
@ -218,20 +220,17 @@ Public Class frmMain
|
||||
GridViewProfile.Columns.Item("ICON").MinWidth = 24
|
||||
GridViewProfile.Columns.Item("ICON").AppearanceCell.BackColor = Color.White
|
||||
|
||||
GridViewProfile.Columns.Item("TL_STATE").SummaryItem.SummaryType = DevExpress.Data.SummaryItemType.Max
|
||||
GridViewProfile.Columns.Item("TL_STATE").SummaryItem.DisplayFormat = "Max: {0}"
|
||||
GridViewProfile.Columns.Item("TL_STATE").SummaryItem.FieldName = "TL_STATE"
|
||||
|
||||
GridViewProfile.Columns("Last edited").DisplayFormat.FormatType = FormatType.DateTime
|
||||
GridViewProfile.Columns("Last edited").DisplayFormat.FormatString = "dd.MM.yyyy HH:MM:ss"
|
||||
|
||||
'GridViewProfile.OptionsBehavior.AlignGroupSummaryInGroupRow = True
|
||||
GridViewProfile.OptionsView.ShowGroupPanel = False
|
||||
GridViewProfile.OptionsBehavior.AutoExpandAllGroups = True
|
||||
GridViewProfile.OptionsView.ShowGroupedColumns = False
|
||||
Catch ex As Exception
|
||||
ClassLogger.Add("Unexpected Error in Formatting Grid: " & ex.Message)
|
||||
End Try
|
||||
|
||||
GridViewProfile.SaveLayoutToXml(GetXML_LayoutName())
|
||||
|
||||
Else
|
||||
GridControlProfile.DataSource = Nothing
|
||||
Try
|
||||
@ -361,6 +360,8 @@ Public Class frmMain
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Private Sub GridViewProfile_DoubleClick(sender As Object, e As EventArgs) Handles GridViewProfile.DoubleClick
|
||||
Try
|
||||
Dim PROFIL_ID = GridViewProfile.GetFocusedRowCellValue(GridViewProfile.Columns("PROFIL_ID"))
|
||||
@ -390,9 +391,29 @@ Public Class frmMain
|
||||
Dim info As GridGroupRowInfo = TryCast(e.Info, GridGroupRowInfo)
|
||||
Dim view As GridView = sender
|
||||
|
||||
|
||||
If info.Column.FieldName = "PROFILE_GROUP_TEXT" Then
|
||||
info.GroupText = info.GroupValueText
|
||||
info.Appearance.BackColor = Color.LightGray
|
||||
|
||||
Dim _color As String
|
||||
|
||||
For Each row As DataRow In DT_VWPM_PROFILE_ACTIVE.Rows
|
||||
If row.Item("PROFILE_GROUP_TEXT") = info.GroupValueText Then
|
||||
_color = row.Item("PROFILE_GROUP_COLOR")
|
||||
End If
|
||||
Next
|
||||
|
||||
Select Case _color
|
||||
Case "Red"
|
||||
info.Appearance.BackColor = Color.LightSalmon
|
||||
Case "Green"
|
||||
info.Appearance.BackColor = Color.LightGreen
|
||||
Case "Yellow"
|
||||
info.Appearance.BackColor = Color.LightGoldenrodYellow
|
||||
Case Else
|
||||
info.Appearance.BackColor = Color.LightGray
|
||||
End Select
|
||||
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@ -427,4 +448,21 @@ Public Class frmMain
|
||||
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
Private Sub GridViewProfile_MouseDown(sender As Object, e As MouseEventArgs) Handles GridViewProfile.MouseDown
|
||||
' Wir brauchen nur einen Doppelklick
|
||||
If e.Button <> MouseButtons.Left Or e.Clicks < 2 Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
Dim view As GridView = sender
|
||||
Dim hi As GridHitInfo = view.CalcHitInfo(e.Location)
|
||||
|
||||
' wenn in eine Group Row Doppelt geklickt wurde..
|
||||
If hi.InGroupRow Then
|
||||
|
||||
' Ein/Ausklappen verhindern
|
||||
DXMouseEventArgs.GetMouseArgs(e).Handled = True
|
||||
End If
|
||||
End Sub
|
||||
End Class
|
||||
Loading…
x
Reference in New Issue
Block a user