Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1187
CalendarInfo datasource and dayview out of sync
posted

We have a datatable that is bound to a calendarinfo instance with a dayview control on the form.  When we add a new row to our datatable, the dayview control doesn't always display that new appointment.  How can force the dayview or calendarinfo control to refresh from the bound datatable?  The problem is odd, it doesn't always happen but when it does all new rows added to the datatable do not show.

 

DataTable:

    Public Shared Function CreateTrafficActionsDT() As DataTable
        Dim dt As New DataTable("traffic_actions")
        dt.Columns.Add("id", GetType(Integer))
        dt.Columns.Add("isdirty", GetType(Boolean))
        dt.Columns.Add("ownerid", GetType(Integer))
        dt.Columns.Add("leadid", GetType(Integer))
        dt.Columns.Add("servicecustomerid", GetType(String))
        dt.Columns.Add("stockno", GetType(String))
        dt.Columns.Add("date_start", GetType(DateTime))
        dt.Columns.Add("date_end", GetType(DateTime))
        dt.Columns.Add("reminder_enabled", GetType(Boolean))
        dt.Columns.Add("reminder_interval", GetType(Integer))
        dt.Columns.Add("alldayflag", GetType(Boolean))
        dt.Columns.Add("subject", GetType(String))
        dt.Columns.Add("subject2", GetType(String))
        dt.Columns.Add("description", GetType(String))
        dt.Columns.Add("action", GetType(String))
        dt.Columns.Add("status", GetType(String))
        dt.Columns.Add("allproperties", GetType(Byte()))
        dt.Columns.Add("leadname", GetType(String))
        dt.Columns.Add("namefirst", GetType(String))
        dt.Columns.Add("namelast", GetType(String))
        dt.Columns.Add("phonehome", GetType(String))
        dt.Columns.Add("phonework", GetType(String))
        dt.Columns.Add("phonemobile", GetType(String))
        dt.Columns.Add("email", GetType(String))
        dt.Columns("id").DefaultValue = 0
        dt.Columns("isdirty").DefaultValue = False
        dt.Columns("ownerid").DefaultValue = 0
        dt.Columns("leadid").DefaultValue = 0
        dt.PrimaryKey = New DataColumn() {dt.Columns("id")}
        Return dt
    End Function

CalendarInfo Binding:

        With ci.DataBindingsForAppointments
            .DataSource = Nothing
            .DataKeyMember = "id"
            .AllDayEventMember = "alldayflag"
            .AllPropertiesMember = "allproperties"
            .AllPropertiesMemberSerializationMode = Infragistics.Win.UltraWinSchedule.DateSerializationMode.SerializeDatesAsLocalTime
            .DescriptionMember = "description"
            .EndDateTimeMember = "date_end"
            .OwnerKeyMember = "ownerid"
            .ReminderEnabledMember = "reminder_enabled"
            .ReminderIntervalMember = "reminder_interval"
            .StartDateTimeMember = "date_start"
            .SubjectMember = "subject2"
            .BindingContextControl = bc
            .DataSource = AppointmentTable
        End With