﻿<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>StrataFrame Forum » StrataFrame Application Framework - V1 » WinForms (How do I?)  » How To: Using SF BO/Business Binding Source with DevExpress Scheduler/Calendar Control</title><generator>InstantForum 2017-1 Final</generator><description>StrataFrame Forum</description><link>http://forum.strataframe.net/</link><webMaster>StrataFrame Forum</webMaster><lastBuildDate>Mon, 25 May 2026 14:40:36 GMT</lastBuildDate><ttl>20</ttl><item><title>How To: Using SF BO/Business Binding Source with DevExpress Scheduler/Calendar Control</title><link>http://forum.strataframe.net/FindPost25460.aspx</link><description>Is anyone using SF BO/Business Binding Source&amp;nbsp;with DevExpress Scheduler/Calendar control?&amp;nbsp; I have successfully used it with the standard .NET table adapter/dataset.&amp;nbsp; I am not able to get it to work with the SF BO/BBS.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;I have looked at the SF Custom Business Binding Source example&amp;nbsp;in Strataflix.&amp;nbsp;&amp;nbsp;&amp;nbsp;The Stratafix example is showing it used with reports.&amp;nbsp; Can anyone tell me&amp;nbsp;if this&amp;nbsp;SF custom BBS will&amp;nbsp;work with the DevX&amp;nbsp;scheduler/calendar control?&amp;nbsp; If so, do you have an example on how you did it or any tips/tricks on getting it to work right?&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jeff</description><pubDate>Thu, 16 Sep 2010 09:36:51 GMT</pubDate><dc:creator>Jeff Pagley</dc:creator></item><item><title>RE: How To: Using SF BO/Business Binding Source with DevExpress Scheduler/Calendar Control</title><link>http://forum.strataframe.net/FindPost28402.aspx</link><description>Hi Jéssica.&lt;br/&gt;&lt;br/&gt;Also, have a look at this post from Paul Chase and it might help you:&lt;br/&gt;&lt;br/&gt;&lt;a href="http://forum.strataframe.net/FindPost8050.aspx"&gt;&lt;a href="http://forum.strataframe.net/FindPost8050.aspx"&gt;http://forum.strataframe.net/FindPost8050.aspx&lt;/a&gt;&lt;/a&gt;&lt;br/&gt;&lt;br/&gt;Abraços. </description><pubDate>Thu, 16 Sep 2010 09:36:51 GMT</pubDate><dc:creator>Ivan George Borges</dc:creator></item><item><title>RE: How To: Using SF BO/Business Binding Source with DevExpress Scheduler/Calendar Control</title><link>http://forum.strataframe.net/FindPost28398.aspx</link><description>It has been a while since I have looked at the DevExpress scheduler, but in this case, I sat down with Jeff when he came to class and showed him how to populate the business object and then manually populate the appointments on the scheduler.&amp;nbsp; I recall the direct binding to this control (outside of StrataFrame included) being a bit tricky with some strange side-effects.</description><pubDate>Thu, 16 Sep 2010 07:52:49 GMT</pubDate><dc:creator>Trent L. Taylor</dc:creator></item><item><title>RE: How To: Using SF BO/Business Binding Source with DevExpress Scheduler/Calendar Control</title><link>http://forum.strataframe.net/FindPost28397.aspx</link><description>&lt;span id=result_box&gt;&lt;span style="background-color: #fff" title="" se="como usar objetos de negocios no xtra Sheduling" te="how to use business objects in xtra sheduling&amp;#13;&amp;#10;&amp;#13;&amp;#10;" closure_uid_udpive="45"&gt;how to use business objects in xtra sheduling&lt;br/&gt;&lt;br/&gt;&lt;/span&gt;&lt;span style="background-color: #fff" title="" se="estou tentando appointments com Business Binding Source with DevExpress Scheduler/Calendar control" te="I'm trying to appointments with Business Binding Source with DevExpress Scheduler / Calendar control&amp;#13;&amp;#10;&amp;#13;&amp;#10;&amp;nbsp;" closure_uid_udpive="46"&gt;I'm trying to appointments with Business Binding Source with DevExpress Scheduler / Calendar control&lt;br/&gt;&lt;br/&gt;&amp;nbsp;&lt;/span&gt;&lt;span title="" se="mas não estou consseguindo alguem pode me ajudar ?" te="conssegui but I'm not someone help me?" closure_uid_udpive="47"&gt;conssegui but I'm not someone help me?&lt;/span&gt;&lt;/span&gt;&amp;nbsp;&lt;span class=gt-icon-text&gt;&lt;/span&gt;&amp;nbsp;&lt;h3&gt;&lt;span id=gt-res-dict-more&gt;&lt;a id=gt-res-dict-link href="http://www.google.com.br/dictionary?source=translation&amp;amp;hl=pt-BR&amp;amp;q=&amp;amp;langpair=en|pt"&gt;&lt;/a&gt;&lt;/span&gt;&amp;nbsp;&lt;/h3&gt;</description><pubDate>Thu, 16 Sep 2010 07:23:57 GMT</pubDate><dc:creator>Jéssica Neves</dc:creator></item><item><title>RE: How To: Using SF BO/Business Binding Source with DevExpress Scheduler/Calendar Control</title><link>http://forum.strataframe.net/FindPost25464.aspx</link><description>Hi Jeff,&lt;br&gt;
&lt;br&gt;
That's right. It was understanding the correct DX events to use was very problematic.&lt;br&gt;
&lt;br&gt;
Cheers, Peter</description><pubDate>Tue, 29 Dec 2009 16:23:21 GMT</pubDate><dc:creator>Peter Jones</dc:creator></item><item><title>RE: How To: Using SF BO/Business Binding Source with DevExpress Scheduler/Calendar Control</title><link>http://forum.strataframe.net/FindPost25462.aspx</link><description>Peter, &lt;/P&gt;&lt;P&gt;Thanks so much for the info.&amp;nbsp; I will take a close look at what you are doing and try to implement it.&amp;nbsp; It is good to know someone has gotten this to work with SF BBS.&amp;nbsp; &lt;/P&gt;&lt;P&gt;Just to be clear about how your form is setup.&amp;nbsp; You have the scheduler storage and control objects, SF BO and SF BBS dropped on the form.&amp;nbsp; You have mapped the scheduler control fields to the BO fields.&amp;nbsp; Then you are managing the updates to the BO within the scheduler storage event handlers.&amp;nbsp; Am I correct on this?&lt;/P&gt;&lt;P&gt;Jeff</description><pubDate>Tue, 29 Dec 2009 07:54:56 GMT</pubDate><dc:creator>Jeff Pagley</dc:creator></item><item><title>RE: How To: Using SF BO/Business Binding Source with DevExpress Scheduler/Calendar Control</title><link>http://forum.strataframe.net/FindPost25461.aspx</link><description>Hi Jeff,&lt;br&gt;
&lt;br&gt;
We have used a BBS as the Appointments data source in a Scheduler Control. That part worked fine but I seem to remember we had a deal of problems just coming to grips with the concepts involved and, as I remember, either the DX documentation wasn't real good or I wasn't real smart in undertstanding it.&lt;br&gt;
&lt;br&gt;
We did get it all working and it works well for us - just simple system housekeeping that we could have probably achieved easier by using the Windows Task Scheduler but we wanted more flexibilty and extensibility for the future.&lt;br&gt;
&lt;br&gt;
FWIW following is all the code in form that contains the Scheduler Control. There may be bits in it that are useful to you but I certainly wouldn't say what we have done is 'best practice'. I know we made heavy going of it at times.&lt;br&gt;
&lt;br&gt;
Cheers, Peter&lt;br&gt;
&lt;br&gt;
Option Explicit On&lt;br&gt;
Option Strict On&lt;br&gt;
&lt;br&gt;
Imports System.Data.SqlClient&lt;br&gt;
Imports DevExpress.XtraGrid&lt;br&gt;
Imports DevExpress.XtraPrinting&lt;br&gt;
Imports clsFU = UtilForms.clsFormUtility&lt;br&gt;
Imports clsFP = UtilForms.clsFormPrint&lt;br&gt;
Imports clsHE = UtilHelp.clsHelp&lt;br&gt;
Imports clsLOC = UtilLocalisation.clsLocalise&lt;br&gt;
Imports clsRTE = UtilRunTimeEnvironment.clsRunTimeEnv&lt;br&gt;
Imports clsSSV = UtilSundry.clsServices&lt;br&gt;
Imports clsLOG = UtilLogging.clsLogging&lt;br&gt;
&lt;br&gt;
Imports MicroFour.StrataFrame.Messaging&lt;br&gt;
Imports Microsoft.VisualBasic&lt;br&gt;
Imports System&lt;br&gt;
Imports System.Collections.Generic&lt;br&gt;
Imports System.ComponentModel&lt;br&gt;
Imports System.Data&lt;br&gt;
Imports System.Drawing&lt;br&gt;
Imports System.Text&lt;br&gt;
Imports System.Windows.Forms&lt;br&gt;
Imports DevExpress.XtraScheduler.UI&lt;br&gt;
Imports DevExpress.XtraScheduler&lt;br&gt;
Imports DevExpress.XtraScheduler.Native&lt;br&gt;
&lt;br&gt;
'&lt;br&gt;
&lt;br&gt;
Public Class frmSCH&lt;br&gt;
&lt;br&gt;
#Region " Initialisation during form loading "&lt;br&gt;
    Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load&lt;br&gt;
&lt;br&gt;
        '  TMS Standard form configuration&lt;br&gt;
        clsFU.LocaliseAllControls(Me)&lt;br&gt;
        clsFU.ConfigureEmbeddedNavigator(Me, Me.Images16x16)&lt;br&gt;
        clsFU.SetLookAndFeel(Me.DefaultLookAndFeel1)&lt;br&gt;
        clsFU.SetTheFormTechName(Me)&lt;br&gt;
        clsFU.SetSundryProperties(Me, Me.Images32x32, clsRTE.RightToLeft, clsRTE.StartXPosition, clsRTE.StartYPosition)&lt;br&gt;
        clsFU.LocaliseSFMessages(Me)&lt;br&gt;
        clsFU.SetGridNonStandardProperties(Me)&lt;br&gt;
        Me.GradientFormHeader1.DetailText = clsRTE.CMPTanneryName&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
        AddHandler schedulerControl1.SelectedAppointments.CollectionChanged, AddressOf SelectedAppointments_CollectionChanged&lt;br&gt;
        AddHandler schedulerControl1.SelectedAppointments.CollectionChanging, AddressOf SelectedAppointments_CollectionChanging&lt;br&gt;
        ' Handle the ParseString and ConvertToString events of the HumanReadableTimeSpanHelper.&lt;br&gt;
        AddHandler HumanReadableTimeSpanHelper.ParseString, AddressOf OnParse&lt;br&gt;
        AddHandler HumanReadableTimeSpanHelper.ConvertToString, AddressOf OnToString&lt;br&gt;
&lt;br&gt;
        schedulerControl1.OptionsCustomization.AllowAppointmentConflicts = AppointmentConflictsMode.Allowed&lt;br&gt;
        schedulerControl1.OptionsCustomization.AllowAppointmentCopy = UsedAppointmentType.None&lt;br&gt;
        schedulerControl1.OptionsCustomization.AllowAppointmentMultiSelect = False&lt;br&gt;
&lt;br&gt;
        schedulerControl1.OptionsView.FirstDayOfWeek = DevExpress.XtraScheduler.FirstDayOfWeek.Sunday&lt;br&gt;
        schedulerControl1.OptionsView.HideSelection = False&lt;br&gt;
        schedulerControl1.OptionsView.NavigationButtons.Visibility = NavigationButtonVisibility.Always&lt;br&gt;
        schedulerControl1.OptionsView.ShowOnlyResourceAppointments = False&lt;br&gt;
        schedulerControl1.OptionsView.ToolTipVisibility = ToolTipVisibility.Always&lt;br&gt;
&lt;br&gt;
        schedulerControl1.OptionsBehavior.RecurrentAppointmentDeleteAction = RecurrentAppointmentAction.Series&lt;br&gt;
        schedulerControl1.OptionsBehavior.RecurrentAppointmentEditAction = RecurrentAppointmentAction.Series&lt;br&gt;
        schedulerControl1.OptionsBehavior.RemindersFormDefaultAction = RemindersFormDefaultAction.SnoozeAll&lt;br&gt;
        schedulerControl1.OptionsBehavior.SelectOnRightClick = True&lt;br&gt;
        schedulerControl1.OptionsBehavior.ShowRemindersForm = True&lt;br&gt;
&lt;br&gt;
        schedulerControl1.GroupType = SchedulerGroupType.Date&lt;br&gt;
&lt;br&gt;
        ' Get the current schedule details from the database and populate the schedule&lt;br&gt;
        ' with a data table.&lt;br&gt;
        CType(Me.PrimaryBusinessObject, UtilBOBase.boTMSMaintBase).TMSStandardFill()&lt;br&gt;
        SchedulerStorage1.Resources.DataSource = Nothing&lt;br&gt;
        SchedulerStorage1.Appointments.DataSource = Nothing&lt;br&gt;
        schedulerControl1.BeginUpdate()&lt;br&gt;
        SchedulerStorage1.BeginUpdate()&lt;br&gt;
        SchedulerStorage1.Appointments.DataSource = Me.BoSCH1.CurrentDataTable&lt;br&gt;
        SchedulerStorage1.EndUpdate()&lt;br&gt;
        schedulerControl1.EndUpdate()&lt;br&gt;
&lt;br&gt;
    End Sub&lt;br&gt;
#End Region&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
#Region " DevExpress customised recurrence form handling "&lt;br&gt;
&lt;br&gt;
    Public Class MyAppointmentForm&lt;br&gt;
        Inherits AppointmentForm&lt;br&gt;
        Public Sub New(ByVal control As SchedulerControl, ByVal apt As Appointment)&lt;br&gt;
            MyBase.New(control, apt)&lt;br&gt;
        End Sub&lt;br&gt;
        Public Sub New(ByVal control As SchedulerControl, ByVal apt As Appointment, ByVal openRecurrenceForm As Boolean)&lt;br&gt;
            MyBase.New(control, apt, openRecurrenceForm)&lt;br&gt;
        End Sub&lt;br&gt;
        Protected Overrides Function CreateAppointmentRecurrenceForm(ByVal patternCopy As Appointment, ByVal firstDayOfWeek As DevExpress.XtraScheduler.FirstDayOfWeek) As Form&lt;br&gt;
            Dim frm As TMSSystemTableMaint.WindowsApplication1.XtraForm1 = New TMSSystemTableMaint.WindowsApplication1.XtraForm1(patternCopy, firstDayOfWeek, Me.Controller)&lt;br&gt;
&lt;br&gt;
            frm.LookAndFeel.ParentLookAndFeel = Me.LookAndFeel&lt;br&gt;
            frm.ShowExceptionsRemoveMsgBox = Me.Controller.AreExceptionsPresent()&lt;br&gt;
            Return frm&lt;br&gt;
&lt;br&gt;
        End Function&lt;br&gt;
&lt;br&gt;
    End Class&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
    Private Sub schedulerControl1_EditAppointmentFormShowing(ByVal sender As Object, ByVal e As AppointmentFormEventArgs) Handles schedulerControl1.EditAppointmentFormShowing&lt;br&gt;
&lt;br&gt;
        Dim frm As New MyAppointmentForm(TryCast(sender, SchedulerControl), e.Appointment, e.OpenRecurrenceForm)&lt;br&gt;
&lt;br&gt;
        ' Standard setting for TMS. Always recurring, always has a reminder and can only&lt;br&gt;
        ' maintain in the recurrence form&lt;br&gt;
&lt;br&gt;
        ' This works fine when the form is opened but when returning to the form&lt;br&gt;
        ' from the recurring form all our Enabled = False are set back to True.&lt;br&gt;
&lt;br&gt;
        CType(frm.Controls("chkReminder"), DevExpress.XtraEditors.CheckEdit).EditValue = True&lt;br&gt;
        CType(frm.Controls("chkAllDay"), DevExpress.XtraEditors.CheckEdit).EditValue = False&lt;br&gt;
        CType(frm.Controls("cbReminder"), DevExpress.XtraScheduler.UI.DurationEdit).EditValue = Parse("0")&lt;br&gt;
&lt;br&gt;
        frm.Controls("edtStartTime").Enabled = False&lt;br&gt;
        frm.Controls("edtStartDate").Enabled = False&lt;br&gt;
        frm.Controls("edtEndTime").Enabled = False&lt;br&gt;
        frm.Controls("edtEndDate").Enabled = False&lt;br&gt;
        frm.Controls("chkAllDay").Enabled = False&lt;br&gt;
        frm.Controls("chkReminder").Enabled = False&lt;br&gt;
        frm.Controls("cbReminder").Enabled = False&lt;br&gt;
&lt;br&gt;
        If Me.BoSCH1.IsDirty Then&lt;br&gt;
            ' Save the dataset to the database if it has changed.&lt;br&gt;
            Me.BoSCH1.Save()&lt;br&gt;
        End If&lt;br&gt;
        '---------------------------------------------&lt;br&gt;
&lt;br&gt;
        e.DialogResult = frm.ShowDialog()&lt;br&gt;
        e.Handled = True&lt;br&gt;
    End Sub&lt;br&gt;
&lt;br&gt;
 &lt;br&gt;
#End Region&lt;br&gt;
&lt;br&gt;
#Region " Time span parsing - standard DX code "&lt;br&gt;
&lt;br&gt;
    Private Function Parse(ByVal str As String) As TimeSpan&lt;br&gt;
&lt;br&gt;
    End Function&lt;br&gt;
    ' Custom parsing of a string to a TimeSpan value.&lt;br&gt;
    Private Sub OnParse(ByVal sender As Object, ByVal e As TimeSpanStringConvertEventArgs)&lt;br&gt;
        Dim val As Double&lt;br&gt;
        Try&lt;br&gt;
            Dim number As String = e.StringValue.Substring(0, e.StringValue.IndexOf(" minutes"))&lt;br&gt;
            val = Convert.ToDouble(number)&lt;br&gt;
        Catch&lt;br&gt;
            val = 0&lt;br&gt;
        End Try&lt;br&gt;
&lt;br&gt;
        e.TimeSpanValue = TimeSpan.FromMinutes(val)&lt;br&gt;
        e.Handled = True&lt;br&gt;
    End Sub&lt;br&gt;
&lt;br&gt;
    ' Custom conversion of a TimeSpan value to a string.&lt;br&gt;
    Private Sub OnToString(ByVal sender As Object, ByVal e As TimeSpanStringConvertEventArgs)&lt;br&gt;
        e.StringValue = "0 minutes" ' e.TimeSpanValue.TotalMinutes.ToString() + "0 minutes"&lt;br&gt;
        e.Handled = True&lt;br&gt;
    End Sub&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
#End Region&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
#Region " TMS code for handling custom fields and propergating changes to the database "&lt;br&gt;
&lt;br&gt;
    Private Sub SchedulerStorage1_AppointmentDeleting(ByVal sender As Object, ByVal e As DevExpress.XtraScheduler.PersistentObjectCancelEventArgs) Handles SchedulerStorage1.AppointmentDeleting&lt;br&gt;
&lt;br&gt;
        ' Delete the in the dataset&lt;br&gt;
        Me.UpdateCustomFieldsInBO(Me.BoSCH1.CurrentRowIndex, False, True)&lt;br&gt;
        InitCustomFieldsB4NewAndAfterDelete()&lt;br&gt;
&lt;br&gt;
    End Sub&lt;br&gt;
&lt;br&gt;
    Private Sub SchedulerStorage1_AppointmentInserting(ByVal sender As Object, ByVal e As DevExpress.XtraScheduler.PersistentObjectCancelEventArgs) Handles SchedulerStorage1.AppointmentInserting&lt;br&gt;
&lt;br&gt;
        Me.schedulerControl1.Visible = False&lt;br&gt;
        Me.btnSaveTMSInfoNewSchedule.Visible = True&lt;br&gt;
&lt;br&gt;
        InitCustomFieldsB4NewAndAfterDelete()&lt;br&gt;
&lt;br&gt;
    End Sub&lt;br&gt;
&lt;br&gt;
    Private Sub InitCustomFieldsB4NewAndAfterDelete()&lt;br&gt;
&lt;br&gt;
        Me.luScheduleJobType.EditValue = 1&lt;br&gt;
        Me.luScheduleRunOn.EditValue = 1&lt;br&gt;
        Me.txtSCHDXSubject.Text = ""&lt;br&gt;
        Me.txtSCHJobFolder.Text = ""&lt;br&gt;
        Me.txtSCHJobName.Text = ""&lt;br&gt;
        Me.txtSCHJobParameters.Text = ""&lt;br&gt;
        Me.txtSCHJobFolder.Focus()&lt;br&gt;
        Me.Refresh()&lt;br&gt;
    End Sub&lt;br&gt;
    Private Sub SchedulerStorage1_AppointmentInserted(ByVal sender As Object, ByVal e As DevExpress.XtraScheduler.PersistentObjectsEventArgs) Handles SchedulerStorage1.AppointmentsInserted&lt;br&gt;
&lt;br&gt;
        ' Ensure the new Appointment has a valid GUID as its PK when it finally gets saved&lt;br&gt;
        ' The new row is always at the end of the dataset.&lt;br&gt;
&lt;br&gt;
        ' At this stage we haven't had a chance to enter our custom field values.&lt;br&gt;
        If BoSCH1.MoveLast Then&lt;br&gt;
            Me.UpdateCustomFieldsInBO(BoSCH1.CurrentRowIndex, True, False)&lt;br&gt;
        End If&lt;br&gt;
&lt;br&gt;
    End Sub&lt;br&gt;
&lt;br&gt;
    '  Private Sub SelectedAppointments_CollectionChanged(ByVal sender As Object, ByVal e As DevExpress.XtraScheduler.CollectionChangedEventArgs(Of DevExpress.XtraScheduler.Appointment))&lt;br&gt;
&lt;br&gt;
    Private Sub SelectedAppointments_CollectionChanged(ByVal sender As Object, ByVal e As DevExpress.Utils.CollectionChangedEventArgs(Of Appointment))&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
        ' This code was used to show the custom field values on the main form.&lt;br&gt;
        ' for the newly selected Appointment.&lt;br&gt;
&lt;br&gt;
        ' Skip this if we are saving a new record&lt;br&gt;
        If Not Me.btnSaveTMSInfoNewSchedule.Visible Then&lt;br&gt;
&lt;br&gt;
            ' Loop through all the selected appointments. Will only every be one becuause&lt;br&gt;
            ' multi-select is turned off&lt;br&gt;
&lt;br&gt;
            For idx As Integer = 0 To schedulerControl1.SelectedAppointments.Count - 1&lt;br&gt;
&lt;br&gt;
                ' This was needed because Custom Fields seem to 'disappear' at times. This&lt;br&gt;
                ' may be my imagination&lt;br&gt;
&lt;br&gt;
                If Not schedulerControl1.SelectedAppointments(idx).CustomFields Is Nothing Then&lt;br&gt;
&lt;br&gt;
                    ' Set focus in the dataset to the appointment just selected.&lt;br&gt;
                    If BoSCH1.SeekToPrimaryKey(schedulerControl1.SelectedAppointments(idx).CustomFields("SCHID")) Then&lt;br&gt;
&lt;br&gt;
                        ' Populate the custome text fields on the main form with the existing info from the dataset&lt;br&gt;
                        If Not IsDBNull(Me.BoSCH1.SCHJobName) Then&lt;br&gt;
                            Me.txtSCHJobName.Text = Me.BoSCH1.SCHJobName.ToString&lt;br&gt;
                        End If&lt;br&gt;
&lt;br&gt;
                        If Not IsDBNull(Me.BoSCH1.SCHJobParameters) Then&lt;br&gt;
                            Me.txtSCHJobParameters.Text = Me.BoSCH1.SCHJobParameters.ToString&lt;br&gt;
                        End If&lt;br&gt;
&lt;br&gt;
                        If Not IsDBNull(Me.BoSCH1.SCHJobFolder) Then&lt;br&gt;
                            Me.txtSCHJobFolder.Text = Me.BoSCH1.SCHJobFolder.ToString&lt;br&gt;
                        End If&lt;br&gt;
&lt;br&gt;
                        If Not IsDBNull(Me.BoSCH1.SCHDXSubject) Then&lt;br&gt;
                            Me.txtSCHDXSubject.Text = Me.BoSCH1.SCHDXSubject.ToString&lt;br&gt;
                        End If&lt;br&gt;
&lt;br&gt;
                        If Not IsDBNull(Me.BoSCH1.SCHRunOn) Then&lt;br&gt;
                            Me.luScheduleRunOn.EditValue = Me.BoSCH1.SCHRunOn&lt;br&gt;
                        End If&lt;br&gt;
&lt;br&gt;
                        If Not IsDBNull(Me.BoSCH1.SCHJobType) Then&lt;br&gt;
                            Me.luScheduleJobType.EditValue = Me.BoSCH1.SCHJobType&lt;br&gt;
                        End If&lt;br&gt;
&lt;br&gt;
                    End If&lt;br&gt;
                End If&lt;br&gt;
            Next&lt;br&gt;
        End If&lt;br&gt;
    End Sub&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
    '   Private Sub SelectedAppointments_CollectionChanging(ByVal sender As Object, ByVal e As DevExpress.XtraScheduler.Native.CollectionChangingEventArgs(Of DevExpress.XtraScheduler.Appointment))&lt;br&gt;
&lt;br&gt;
    Private Sub SelectedAppointments_CollectionChanging(ByVal sender As Object, ByVal e As DevExpress.Utils.CollectionChangingEventArgs(Of Appointment))&lt;br&gt;
&lt;br&gt;
        ' Loop through all the selected appointments. Will only every be one becuause&lt;br&gt;
        ' multi-select is turned off. At this stage the selected Appointment is&lt;br&gt;
        ' the one about to loose focus.&lt;br&gt;
&lt;br&gt;
        Dim UpdateNeeded As Boolean = False&lt;br&gt;
&lt;br&gt;
        For idx As Integer = 0 To schedulerControl1.SelectedAppointments.Count - 1&lt;br&gt;
&lt;br&gt;
            ' This was needed because Custom Fields seem to disappear at times. This&lt;br&gt;
            ' may be my imagination&lt;br&gt;
&lt;br&gt;
            If Not schedulerControl1.SelectedAppointments(idx).CustomFields Is Nothing Then&lt;br&gt;
&lt;br&gt;
                If BoSCH1.SeekToPrimaryKey(schedulerControl1.SelectedAppointments(idx).CustomFields("SCHID")) Then&lt;br&gt;
&lt;br&gt;
                    ' Only change the dataset if there has been a change to values&lt;br&gt;
                    ' in our custom fields.&lt;br&gt;
                    If Me.BoSCH1.SCHJobName &lt;&gt; Me.txtSCHJobName.Text OrElse _&lt;br&gt;
                        Me.BoSCH1.SCHJobParameters &lt;&gt; Me.txtSCHJobParameters.Text OrElse _&lt;br&gt;
                        Me.BoSCH1.SCHJobFolder &lt;&gt; Me.txtSCHJobFolder.Text Then&lt;br&gt;
                        UpdateNeeded = True&lt;br&gt;
                    ElseIf Me.luScheduleRunOn.EditValue Is Nothing Then&lt;br&gt;
                        UpdateNeeded = False&lt;br&gt;
                    ElseIf Me.BoSCH1.SCHRunOn.Value &lt;&gt; CType(Me.luScheduleRunOn.EditValue, Integer) Then&lt;br&gt;
                        UpdateNeeded = True&lt;br&gt;
                    ElseIf Me.luScheduleJobType.EditValue Is Nothing Then&lt;br&gt;
                        UpdateNeeded = False&lt;br&gt;
                    ElseIf Me.BoSCH1.SCHJobType.Value &lt;&gt; CType(Me.luScheduleJobType.EditValue, Integer) Then&lt;br&gt;
                        UpdateNeeded = True&lt;br&gt;
                    End If&lt;br&gt;
&lt;br&gt;
                    If UpdateNeeded Then&lt;br&gt;
                        Me.UpdateCustomFieldsInBO(Me.BoSCH1.CurrentRowIndex, False, False)&lt;br&gt;
                    End If&lt;br&gt;
                End If&lt;br&gt;
            End If&lt;br&gt;
        Next&lt;br&gt;
&lt;br&gt;
    End Sub&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
    Private Sub btnSaveTMSInfo_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSaveTMSInfoNewSchedule.Click&lt;br&gt;
&lt;br&gt;
        ' Save the TMS specific info for a new record.&lt;br&gt;
        ' New records are always at the end of the dataset.&lt;br&gt;
        If BoSCH1.MoveLast Then&lt;br&gt;
            Me.txtSCHDXSubject.Text = Me.BoSCH1.SCHDXSubject&lt;br&gt;
            Me.UpdateCustomFieldsInBO(Me.BoSCH1.CurrentRowIndex, False, False)&lt;br&gt;
        End If&lt;br&gt;
&lt;br&gt;
        ' Back to normal maintenance&lt;br&gt;
        Me.txtSCHJobFolder.Focus()&lt;br&gt;
        Me.btnSaveTMSInfoNewSchedule.Visible = False&lt;br&gt;
        Me.schedulerControl1.Visible = True&lt;br&gt;
        Me.Refresh()&lt;br&gt;
&lt;br&gt;
    End Sub&lt;br&gt;
&lt;br&gt;
    Private Sub UpdateCustomFieldsInBO(ByVal RowIndex As Integer, ByVal CreatePKOnly As Boolean, ByVal DeleteOnly As Boolean)&lt;br&gt;
&lt;br&gt;
        ' The MoveAbsolutes is needed because the code "boSCH1?? = txtSCH??" below actually&lt;br&gt;
        ' sets the current row index in the BO to 0. No idea why.&lt;br&gt;
&lt;br&gt;
        ' Updating the BO caused following events to fire. Cleary the appointements know&lt;br&gt;
        ' when the underlying dataset changes. Anyway Removing and readding the handlers seemed&lt;br&gt;
        ' fix that problem&lt;br&gt;
&lt;br&gt;
        RemoveHandler schedulerControl1.SelectedAppointments.CollectionChanging, AddressOf SelectedAppointments_CollectionChanging&lt;br&gt;
        RemoveHandler schedulerControl1.SelectedAppointments.CollectionChanged, AddressOf SelectedAppointments_CollectionChanged&lt;br&gt;
&lt;br&gt;
        If CreatePKOnly Then&lt;br&gt;
&lt;br&gt;
            Me.BoSCH1.MoveAbsolute(RowIndex)&lt;br&gt;
            Me.BoSCH1.SCHID = Guid.NewGuid&lt;br&gt;
&lt;br&gt;
        ElseIf DeleteOnly Then&lt;br&gt;
&lt;br&gt;
            Me.BoSCH1.MoveAbsolute(RowIndex)&lt;br&gt;
            Me.BoSCH1.DeleteCurrentRow()&lt;br&gt;
&lt;br&gt;
        Else&lt;br&gt;
            Me.BoSCH1.MoveAbsolute(RowIndex)&lt;br&gt;
            Me.BoSCH1.SCHJobFolder = Me.txtSCHJobFolder.Text&lt;br&gt;
&lt;br&gt;
            Me.BoSCH1.MoveAbsolute(RowIndex)&lt;br&gt;
            Me.BoSCH1.SCHJobName = Me.txtSCHJobName.Text&lt;br&gt;
&lt;br&gt;
            Me.BoSCH1.MoveAbsolute(RowIndex)&lt;br&gt;
            Me.BoSCH1.SCHJobParameters = Me.txtSCHJobParameters.Text&lt;br&gt;
&lt;br&gt;
            Me.BoSCH1.MoveAbsolute(RowIndex)&lt;br&gt;
            Me.BoSCH1.SCHJobType = CType(Me.luScheduleJobType.EditValue, Integer)&lt;br&gt;
&lt;br&gt;
            Me.BoSCH1.MoveAbsolute(RowIndex)&lt;br&gt;
            Me.BoSCH1.SCHRunOn = CType(Me.luScheduleRunOn.EditValue, Integer)&lt;br&gt;
&lt;br&gt;
        End If&lt;br&gt;
&lt;br&gt;
        Me.BoSCH1.MoveAbsolute(RowIndex)&lt;br&gt;
        Me.BoSCH1.Save()&lt;br&gt;
        Me.BoSCH1.MoveAbsolute(RowIndex)&lt;br&gt;
&lt;br&gt;
        AddHandler schedulerControl1.SelectedAppointments.CollectionChanging, AddressOf SelectedAppointments_CollectionChanging&lt;br&gt;
        AddHandler schedulerControl1.SelectedAppointments.CollectionChanged, AddressOf SelectedAppointments_CollectionChanged&lt;br&gt;
&lt;br&gt;
    End Sub&lt;br&gt;
#End Region&lt;br&gt;
&lt;br&gt;
#Region " Help button processing "&lt;br&gt;
&lt;br&gt;
    Private Sub btnHelp_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnHelp.Click&lt;br&gt;
&lt;br&gt;
        clsHE.FormHelpClicked(Me.Name, False, clsRTE.UserName)&lt;br&gt;
&lt;br&gt;
    End Sub&lt;br&gt;
&lt;br&gt;
#End Region&lt;br&gt;
&lt;br&gt;
#Region " Standard Event Handling for Form using clsFormUtility "&lt;br&gt;
&lt;br&gt;
    Private Sub LogInfo(ByVal Message As String)&lt;br&gt;
        Dim LogMsg As New System.Text.StringBuilder&lt;br&gt;
        LogMsg.AppendFormat("{1} - {2} at {3}{0}{4}", _&lt;br&gt;
                            Environment.NewLine, _&lt;br&gt;
                            "HouseKeepingScheduleMaint", _&lt;br&gt;
                            Now.ToLongDateString, _&lt;br&gt;
                            Now.ToShortTimeString, _&lt;br&gt;
                            Message)&lt;br&gt;
        clsLOG.LogTMSEvent(LogMsg.ToString, UtilLogging.clsLogging.TMSLogType.TMSServices)&lt;br&gt;
    End Sub&lt;br&gt;
&lt;br&gt;
    '---------------------------------------------------------------&lt;br&gt;
    ' Form Closing and Closed&lt;br&gt;
    ' Note: the specific nature of Form Load precludes its inclusion here.&lt;br&gt;
&lt;br&gt;
    Private Sub ThisForm_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) _&lt;br&gt;
    Handles Me.FormClosed&lt;br&gt;
        Try&lt;br&gt;
            clsFU.HandleFormClosed(CType(sender, System.Windows.Forms.Form), e)&lt;br&gt;
        Catch ex As Exception&lt;br&gt;
        End Try&lt;br&gt;
    End Sub&lt;br&gt;
&lt;br&gt;
    Private Sub ThisForm_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) _&lt;br&gt;
    Handles Me.FormClosing&lt;br&gt;
&lt;br&gt;
        Try&lt;br&gt;
            If Me.BoSCH1.IsDirty Then&lt;br&gt;
                BoSCH1.Save()&lt;br&gt;
            End If&lt;br&gt;
            LogInfo("Restarting TMSHousekeepingService in frmSCH")&lt;br&gt;
            clsSSV.RestartService("TMSHousekeepingService")&lt;br&gt;
            LogInfo("Restarted TMSHousekeepingService in frmSCH")&lt;br&gt;
            clsFU.HandleFormClosing(CType(sender, System.Windows.Forms.Form), e)&lt;br&gt;
        Catch ex As Exception&lt;br&gt;
&lt;br&gt;
        End Try&lt;br&gt;
&lt;br&gt;
    End Sub&lt;br&gt;
&lt;br&gt;
#End Region&lt;br&gt;
&lt;br&gt;
End Class&lt;br&gt;
&lt;br&gt;</description><pubDate>Mon, 28 Dec 2009 21:53:29 GMT</pubDate><dc:creator>Peter Jones</dc:creator></item></channel></rss>