RadScheduler disappearing

7 posts, 0 answers
  1. Joseph
    Joseph avatar
    9 posts
    Member since:
    Oct 2010

    Posted 06 Jan 2011 Link to this post

  2. Hello,
    I am a new user trying to follow along with the RadScheduler webinar introduction.  I have everything set up to the point of database binding.  I am following through the examples, set up the connections to the sql server, edited the connections, but when I get as far as binding the radscheduler to the BindingSource, the RadScheduler is invisible during runtime (however if you right click where it is supposed to be you still get a "New Appointment" menu.  It seems that all off the hard coded resources and all the properties set upon form load are not taking effect to the radscheduler ONLY if I am using the smart tag to bind the bindingSource.

    Any ideas of what I may be overlooking?
    Thanks!
  • Joseph
    Joseph avatar
    9 posts
    Member since:
    Oct 2010

    Posted 07 Jan 2011 Link to this post

    Attached is a picture to describe the problem I am encountering.  Everything looks great, up until the point I use the smart tag on the radscheduler to bind the data source.  Then the radscheduler is invisible during runtime, the date also seems to get thrown off and no resources show up when I try to create new appointment.  Must be something I did wrong with the datasource?  I have been trying to follow the webinar and converting Robert's C# to vb.net.  Thanks!

     

    Private Sub RadForm1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

     

     

    'TODO: This line of code loads data into the 'AppointmentsDataSet.Appointments' table. You can move, or remove it, as needed.

     

     

    'Me.AppointmentsTableAdapter.Fill(Me.AppointmentsDataSet.Appointments)

     

     

    Dim colors() As Color = {Color.LightBlue, Color.LightGreen, Color.LightYellow, Color.Red, Color.Orange, Color.Pink, Color.Purple, Color.Peru, Color.PowderBlue}

     

     

    Dim names() As String = {"Joseph Regan", "Anne Dodsworth", "Boyan Mastoni", "Richard Duncan", "Maria Shnaider", "Carmen Louis"}

     

     

    For i As Integer = 0 To names.Length - 1

     

     

    Dim resource As New Resource()

     

    resource.Id =

    New EventId(i)

     

    resource.Name = names(i)

    resource.Color = colors(i)

     

    'resource.Image = Me.imageList1.Images(i)

     

     

    Me.RadScheduler1.Resources.Add(resource)

     

     

    Next i

     

    RadScheduler1.HeaderFormat =

    "dddd MMMM dd, yyyy"

     

    RadScheduler1.GetDayView().DayCount = 1

    RadScheduler1.ActiveView.ResourcesPerView = 5

    RadScheduler1.GroupType = GroupType.Resource

     

     

    Dim appointmentsAdapter As New AppointmentsDataSetTableAdapters.AppointmentsTableAdapter()

     

    appointmentsAdapter.Fill(AppointmentsDataSet.Appointments)

     

    Dim resourcesAdapter As New AppointmentsDataSetTableAdapters.ResourcesTableAdapter()

     

    resourcesAdapter.Fill(AppointmentsDataSet.Resources)

     

    Dim appointmentsResourceAdapter As New AppointmentsDataSetTableAdapters.AppointmentsResourcesTableAdapter()

     

    appointmentsResourceAdapter.Fill(AppointmentsDataSet.AppointmentsResources)

    RadCalendar1.AllowMultipleView =

    True

     

    RadCalendar1.MultiViewRows = 3

     

     

     

    End Sub

     

     

     

    Private Sub RadScheduler1_ActiveViewChanged(ByVal sender As Object, ByVal e As Telerik.WinControls.UI.SchedulerViewChangedEventArgs)

     

    RadScheduler1.ActiveView.ResourcesPerView = 5

     

    End Sub

     

     

    Private Sub RadCalendar1_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadCalendar1.SelectionChanged

     

    RadScheduler1.ActiveView.StartDate = RadCalendar1.SelectedDate

     

    End Sub

     

     

    Private Sub AppointmentsDataSetBindingSource_CurrentChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AppointmentsDataSetBindingSource.CurrentChanged

     

     

    End Sub

     

     

    Private Sub RadButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadButton1.Click

     

     

    Dim appointmentTableAdapter As New AppointmentsDataSetTableAdapters.AppointmentsTableAdapter()

     

     

    Dim appointmentResourcesTableAdapter As New AppointmentsDataSetTableAdapters.AppointmentsResourcesTableAdapter()

     

     

    Dim deletedChildRecords As AppointmentsDataSet.AppointmentsResourcesDataTable = Me.AppointmentsDataSet.AppointmentsResources.GetChanges(DataRowState.Deleted)

     

     

    Dim newChildRecords As AppointmentsDataSet.AppointmentsResourcesDataTable = Me.AppointmentsDataSet.AppointmentsResources.GetChanges(DataRowState.Added)

     

     

    Dim modifiedChildRecords As AppointmentsDataSet.AppointmentsResourcesDataTable = Me.AppointmentsDataSet.AppointmentsResources.GetChanges(DataRowState.Modified)

     

     

    Try

     

     

    If deletedChildRecords IsNot Nothing Then

     

    appointmentResourcesTableAdapter.Update(deletedChildRecords)

     

    End If

     

    appointmentTableAdapter.Update(AppointmentsDataSet.Appointments)

     

    If newChildRecords IsNot Nothing Then

     

    appointmentResourcesTableAdapter.Update(newChildRecords)

     

    End If

     

     

    If modifiedChildRecords IsNot Nothing Then

     

    appointmentResourcesTableAdapter.Update(modifiedChildRecords)

     

    End If

     

    AppointmentsDataSet.AcceptChanges()

     

    Catch ex As Exception

     

     

    Throw ex

     

     

    Finally

     

     

    If deletedChildRecords IsNot Nothing Then

     

    deletedChildRecords.Dispose()

     

    End If

     

     

    If newChildRecords IsNot Nothing Then

     

    newChildRecords.Dispose()

     

    End If

     

     

    If modifiedChildRecords IsNot Nothing Then

     

    modifiedChildRecords.Dispose()

     

    End If

     

     

    End Try

     

     

    End Sub

     

  • UI for WinForms is Visual Studio 2017 Ready
  • Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 07 Jan 2011 Link to this post

    Hello,

    Unfortunatly I haven't been able to replicate your issue. I was wondering if this may be an issue with the data source. Please could you try something for me? Take your code, and add it to a new project, but leave out the
    Dim appointmentsAdapter As New AppointmentsDataSetTableAdapters.AppointmentsTableAdapter()
     appointmentsAdapter.Fill(AppointmentsDataSet.Appointments)
     Dim resourcesAdapter As New AppointmentsDataSetTableAdapters.ResourcesTableAdapter()
      resourcesAdapter.Fill(AppointmentsDataSet.Resources)
     Dim appointmentsResourceAdapter As New AppointmentsDataSetTableAdapters.AppointmentsResourcesTableAdapter()
    appointmentsResourceAdapter.Fill(AppointmentsDataSet.AppointmentsResources)

    Let me know if you can then see your scheduler correctly. If this does work, what happens when you add back in the data source?
    Look forward to hearing back from you
    Richard
  • Dobry Zranchev
    Admin
    Dobry Zranchev avatar
    348 posts

    Posted 10 Jan 2011 Link to this post

    Hi Joseph,

    Thank you for writing.

    You can find the answer to your question in the other thread that you have created about the same topic.

    Greetings,
    Dobry Zranchev
    the Telerik team
    Q3’10 SP1 of RadControls for WinForms is available for download; also available is the Q1'11 Roadmap for Telerik Windows Forms controls.
  • Joseph
    Joseph avatar
    9 posts
    Member since:
    Oct 2010

    Posted 13 Jan 2011 Link to this post

    Thank you Richard.
    Sorry it took long to get back to you, my HDD crashed and I had to redo everything!

    Yes, when I take out that code, the scheduler has reappeared again. 
    The second I click "Save" button, the scheduler disappears again, ALTHOUGH IT DOES SEEM TO SAVE!  So perhaps that code you told me to take out is incorrect?

    I have isolated the problematic code:

     

    Dim resourcesAdapter As New SchedulerDataSetTableAdapters.ResourcesTableAdapter()

     

     

    resourcesAdapter.Fill(SchedulerDataSet.Resources)

     

    When these two lines are commented out, the scheduler does appear, but does not show appointments in schedule (does seem to write to schedule -- but then the scheduler disappears!)  Attached is a screenshot of database map.  Thanks


    Thanks again!


  • Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 13 Jan 2011 Link to this post

    Hello,

    The response from Telerik in this thread says that you have an answer in a support ticket. Has this not solved it for you?
    If not, I would suggest reconfiguring your datasource.
    Regards,
    Richard
  • Joseph
    Joseph avatar
    9 posts
    Member since:
    Oct 2010

    Posted 18 Jan 2011 Link to this post

    Thank you everyone for pointing me in the right direction, especially about the database connections causing the problem.  The support ticket is attempting to fix the problem, thanks!
  • Back to Top
    UI for WinForms is Visual Studio 2017 Ready