61 lines
2.4 KiB
VB.net
61 lines
2.4 KiB
VB.net
Imports System
|
|
Imports System.ComponentModel
|
|
Imports System.Collections.Generic
|
|
Imports System.Diagnostics
|
|
Imports System.Text
|
|
|
|
Imports DevExpress.ExpressApp
|
|
Imports DevExpress.ExpressApp.Actions
|
|
Imports DevExpress.Persistent.Base
|
|
Imports DevExpress.ExpressApp.Win.Editors
|
|
|
|
Public Class Subcontractor_VC
|
|
Inherits DevExpress.ExpressApp.ViewController(Of ListView)
|
|
Private _GridListEditor As GridListEditor
|
|
|
|
Public Sub New()
|
|
MyBase.New()
|
|
InitializeComponent()
|
|
RegisterActions(components)
|
|
End Sub
|
|
Protected Overrides Sub OnDeactivated()
|
|
MyBase.OnDeactivated()
|
|
If View.Id = "Subcontractor_SubcontractorCustomers_ListView" Then
|
|
If _GridListEditor IsNot Nothing Then
|
|
RemoveHandler _GridListEditor.GridView.CellValueChanged, AddressOf Subcontractor_SubcontractorCustomers_ListView_CellValueChanged
|
|
End If
|
|
End If
|
|
End Sub
|
|
Protected Overrides Sub OnViewControlsCreated()
|
|
MyBase.OnViewControlsCreated()
|
|
If View.Id = "Subcontractor_SubcontractorCustomers_ListView" Then
|
|
_GridListEditor = TryCast(View.Editor, GridListEditor)
|
|
|
|
If _GridListEditor IsNot Nothing Then
|
|
AddHandler _GridListEditor.GridView.CellValueChanged, AddressOf Subcontractor_SubcontractorCustomers_ListView_CellValueChanged
|
|
End If
|
|
|
|
'If _GridListEditor IsNot Nothing Then
|
|
' _GridListEditor.AllowEdit = True
|
|
' For i As Integer = 0 To _GridListEditor.Columns.Count - 1
|
|
' If _GridListEditor.GridView.Columns(i).FieldName <> "Workplace" Then
|
|
|
|
' _GridListEditor.GridView.Columns(i).OptionsColumn.ReadOnly = True
|
|
' _GridListEditor.GridView.Columns(i).OptionsColumn.AllowEdit = False
|
|
' _GridListEditor.GridView.Columns(i).OptionsColumn.TabStop = False
|
|
' End If
|
|
' Next i
|
|
'End If
|
|
End If
|
|
End Sub
|
|
Private Sub Subcontractor_SubcontractorCustomers_ListView_CellValueChanged(sender As Object, e As DevExpress.XtraGrid.Views.Base.CellValueChangedEventArgs)
|
|
Dim nestedFrame As NestedFrame = TryCast(Frame, NestedFrame)
|
|
If nestedFrame IsNot Nothing Then
|
|
Dim parentView As View = nestedFrame.View
|
|
parentView.ObjectSpace.CommitChanges()
|
|
'parentView.ObjectSpace.Refresh()
|
|
End If
|
|
End Sub
|
|
|
|
End Class
|