Solutions Schedule for Silverlight - Gantt style drag and drop multi resource scheduling  
How To ...
         
    Quickly Add a Visual Calendar to an Application    
   
           
      Continuing from Todd G Landrum's blog post about the DBI Calendar COM 64 licenses that were provided for all 2016 Southwest Fox Conference Attendees...    
           
      Todd started off explaining that one of his clients was looking for a quicker and easier way to view and change appointments in a schedule. The original list format design wasn't the most efficient anymore.    
           
      Having attended the 2016 Southwest Fox conference Todd has a full developer's license of DBI Calendar COM 64 in his toolbox and thought maybe this was a good time to give it a try.    
           
      read the rest of Todd's blog item here =    
      https://blog.paladinpgm.com/2017/03/06/dbi-calendar-control/    
           
      From this:    
           
      Paladin Appointment Book List Format    
           
      To this in Four Hours!    
           
         
           
           
      Now, this type of quick turn-around functionality is not only limited to DBI's ActiveX / COM component products.  It's just as straightforward, quick and easy to implement similar functionality using WinForms (VB .NET or C#)  and  XAML.  Have a look...    
           
           
      Adding an Appointment to a DBI Calendar Component    
     

VB.NET

For Each currRow In filterAppointments

'create a new appointments collection appointment object

Dim dvAppointment As New Dbi.PIM.dbiAppointmentItem

'Set the properties of the appointment item object

dvAppointment.Start = currRow("StartDateTime")
dvAppointment.End = currRow("EndDateTime")
dvAppointment.AllDayEvent = currRow("AllDayEvent")
dvAppointment.Text = currRow("AppointmentText")
dvAppointment.EntryID = currRow("AppointmentID").ToString

'* * * * * NOTE: VERY IMPORTANT! * * * * *
'Set the appointment object's tag to store a pointer to the record in the table it represents. This allows the developer to reflect any changes or deletes to the appointment back to the table through the record stored in its tag property.

dvAppointment.Tag = currRow

'Add the appointment item object to the dbiDayView's appointments collection.

Me.DbiDayView1.Appointments.Add(dvAppointment)

Next

C#

foreach(DataRow currRow in filterAppointments)

{

 

//create a new appointments collection appointment object

Dbi.PIM.dbiAppointmentItem dvAppointment = new Dbi.PIM.dbiAppointmentItem();

//Set the properties of the appointment item object
dvAppointment.Start = (DateTime)currRow["StartDateTime"];
dvAppointment.End = (DateTime)currRow["EndDateTime"];
dvAppointment.AllDayEvent = (bool)currRow["AllDayEvent"];
dvAppointment.Text = (string)currRow["AppointmentText"];
dvAppointment.EntryID = (string)currRow["AppointmentID"].ToString();

//* * * * * NOTE: VERY IMPORTANT! * * * * *
//Set the appointment object's tag to store a pointer to the record in the table it represents. This allows
//the developer to reflect any changes or deletes to the appointment back to the table through the record

//stored in its tag property.

 

dvAppointment.Tag = currRow;

//Add the appointment item object to the dbiDayView's appointments collection.


this.DbiDayView1.Appointments.Add(dvAppointment);

}

   
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
           
           
      DBI Calendar WinForms / XAML Appointments with Data Binding    
           
           
      Write changes back to database    
     

VB.NET

Private Sub DbiDayView1_AfterAppointmentChange(ByVal sender As Object, ByVal e As Dbi.WinControl.DayView.AfterAppointmentChangeEventArgs) Handles DbiDayView1.AfterAppointmentChange

 

'NOTE: The AfterAppointmentChange event fires when an appointment in the dbiDayView collection is moved or resized. This occurs when a user moves an appointment by clicking and dragging with the mouse, or when an appointment's start/end is changed by clicking and dragging with the mouse.

If Not editMode Then

 

'NOTE: Changing the appointment in the detail dialog will cause the AfterAppointmentChange event to fire.

''The editMode public variable is used to programmatically distinguish between changes made in the detail dialog and those made directly through the dbiDayView interface.

Dim recordRow As DayViewDemo.AppointmentsRow

'Cast the DataRow stored in the appointment object tag back into a data row.

recordRow = e.Appointment.Tag

'Set the Start, End, and AllDay flag fields in the database record.

recordRow.Item("StartDateTime") = e.Appointment.Start
recordRow.Item("EndDateTime") = e.Appointment.End
recordRow.Item("AllDayEvent") = e.Appointment.AllDayEvent

End If

End Sub

 

C#

private void DbiDayView1_AfterAppointmentChange(object sender, Dbi.WinControl.DayView.AfterAppointmentChangeEventArgs e)
{

 

//NOTE: The AfterAppointmentChange event fires when an appointment in the dbiDayView collection is moved or resized. This occurs when a user moves an appointment by clicking and dragging with the mouse, or when an appointment's start/end is changed by clicking and dragging with the mouse.

if (!editMode)
{

 

//NOTE: Changing the appointment in the detail dialog will cause the AfterAppointmentChange event to fire.The editMode public variable is used to programmatically distinguish between changes made in the detail dialog and those made directly through the dbiDayView interface.

CalendarDemo.AppointmentsRow recordRow;

//Cast the DataRow stored in the appointment object tag back into a data row.

recordRow = (CalendarDemo.AppointmentsRow)e.Appointment.Tag;

//Set the Start, End, and AllDay flag fields in the database record.

recordRow["StartDateTime"] = (DateTime)e.Appointment.Start;
recordRow["EndDateTime"] = (DateTime)e.Appointment.End;
recordRow["AllDayEvent"] = (bool)e.Appointment.AllDayEvent;

}

}

   
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
         
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
     
       
       
    Have a Great Programming Day !    
       
       
       
DBI Support Products Downloads Purchase
         
Customers Support Request Form COM Tools Trial Downloads Order Page
News Releases FAQ dbi Calendar Silverlight Online Evaluations Academic
Contact Us License Registration dbi Calendar WPF Legacy
Updates Extractor - Text Analytics Events
Utilities Solutions Schedule for COM
Support Policies Solutions Schedule Silverlight
Product Life Support Solutions Schedule for .NET
Platform Products Solutions Schedule WPF
Contact Us Studio Controls for COM
  Studio Controls for .NET
.NET Scheduling Framework
  all rights reserved  |  copyright  1996 - 2017 |  Terms of Use