0% found this document useful (0 votes)
205 views3 pages

DevExpress Scheduler

Uploaded by

Shefat Phiri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
205 views3 pages

DevExpress Scheduler

Uploaded by

Shefat Phiri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

AddHandler schedulerStorage1.

AppointmentsInserted, AddressOf
schedulerStorage1_AppointmentsInserted
AddHandler schedulerStorage1.AppointmentsChanged, AddressOf
schedulerStorage1_AppointmentsChanged
AddHandler schedulerStorage1.AppointmentsDeleted, AddressOf
schedulerStorage1_AppointmentsDeleted

Private Sub schedulerStorage1_AppointmentsChanged(ByVal sender As Object,


ByVal e As PersistentObjectsEventArgs)
CommitTask()
End Sub

Private Sub schedulerStorage1_AppointmentsDeleted(ByVal sender As Object,


ByVal e As PersistentObjectsEventArgs)
CommitTask()
End Sub
Private Sub schedulerStorage1_AppointmentsInserted(ByVal sender As Object,
ByVal e As PersistentObjectsEventArgs)

CommitTask()
schedulerStorage1.SetAppointmentId((CType(e.Objects(0), Appointment)),
id)
End Sub
Private Sub CommitTask()

appointmentsTableAdapter.Update(gantTestDataSet)
Me.gantTestDataSet.AcceptChanges()
End Sub

AddHandler schedulerStorage1.AppointmentDependenciesInserted, AddressOf


schedulerStorage1_AppointmentDependenciesInserted
AddHandler schedulerStorage1.AppointmentDependenciesChanged, AddressOf
schedulerStorage1_AppointmentDependenciesChanged
AddHandler schedulerStorage1.AppointmentDependenciesDeleted, AddressOf
schedulerStorage1_AppointmentDependenciesDeleted

Private Sub schedulerStorage1_AppointmentDependenciesChanged(ByVal sender


As Object, ByVal e As PersistentObjectsEventArgs)
CommitTaskDependency()
End Sub
Private Sub schedulerStorage1_AppointmentDependenciesDeleted(ByVal sender
As Object, ByVal e As PersistentObjectsEventArgs)
CommitTaskDependency()
End Sub

Private Sub schedulerStorage1_AppointmentDependenciesInserted(ByVal sender


As Object, ByVal e As PersistentObjectsEventArgs)
CommitTaskDependency()
End Sub
Private Sub CommitTaskDependency()
taskDependenciesTableAdapter.Update(Me.gantTestDataSet)
Me.gantTestDataSet.AcceptChanges()
End Sub

schedulerStorage1.Appointments.CommitIdToDataSource = False
AddHandler appointmentsTableAdapter.Adapter.RowUpdated, AddressOf
appointmentsTableAdapter_RowUpdated

Private id As Integer = 0
Private Sub appointmentsTableAdapter_RowUpdated(ByVal sender As Object,
ByVal e As SqlRowUpdatedEventArgs)
If e.Status = UpdateStatus.Continue AndAlso e.StatementType =
StatementType.Insert Then
id = 0
Using cmd As New SqlCommand("SELECT @@IDENTITY",
appointmentsTableAdapter.Connection)
id = Convert.ToInt32(cmd.ExecuteScalar())
e.Row("UniqueId") = id
End Using
End If
End Sub

schedulerControl1.ActiveViewType = SchedulerViewType.Gantt
schedulerControl1.GroupType = SchedulerGroupType.Resource
schedulerControl1.GanttView.CellsAutoHeightOptions.Enabled = True
' Hide unnecessary visual elements.
schedulerControl1.GanttView.ShowResourceHeaders = False
schedulerControl1.GanttView.NavigationButtonVisibility =
NavigationButtonVisibility.Never
' Disable user sorting in the Resource Tree (clicking the column will not
change the sort order).
colDescription.OptionsColumn.AllowSort = False

You might also like