Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic LoadFromDataSource + Resources = not shown (Read 2665 times)
manobra
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 2
Joined: Aug 29th, 2011
LoadFromDataSource + Resources = not shown
Aug 29th, 2011 at 12:39am
Print Post  
Meppy, please help me!

I've already read ALL posts about "databinding" and my problem still persists.

i'm using VB.Net (2008) + planner latest version (trial mode).

Grouping by: Resources

All fields are using default mapping

I'm adding resources by: _calendar.Resources.Add(resource) method

and adding appointments by: _calendar.Schedule.Items.Add(app) method

I've followed the Tutorial 9 at least 4 times (cleanning and doing again). i'm using the same control names used in tutorial 9.

The "SaveToDataSource" and "LoadFromDataSource" happens without error, but no resource or item appear in Calendar.

I've tried everything you said to: http://mindfusion.eu/Forum/YaBB.pl?board=calnet_disc;action=display;num=1248766692

But no items are shown in my calendar.

What i'm doing wrong?

Below is my last try.

Sub load_state()

_calendar.Resources.Clear()
_calendar.Schedule.Items.Clear()
_calendar.Contacts.Clear()
_calendar.Tasks.Clear()

PlannerDataSet.Clear()

ReminderTableAdapter1.Fill(PlannerDataSet.Reminder)
StyleTableAdapter1.Fill(PlannerDataSet.Style)
CustomBrushesTableAdapter1.Fill(PlannerDataSet.CustomBrushes)
ContactTableAdapter1.Fill(PlannerDataSet.Contact)
LocationTableAdapter1.Fill(PlannerDataSet.Location)
ResourceTableAdapter1.Fill(PlannerDataSet.Resource)
TaskTableAdapter1.Fill(PlannerDataSet.Task)
ItemTableAdapter1.Fill(PlannerDataSet.Item)
ItemContactsTableAdapter1.Fill(PlannerDataSet.ItemContacts)
ItemResourcesTableAdapter1.Fill(PlannerDataSet.ItemResources)
RecurrenceTableAdapter1.Fill(PlannerDataSet.Recurrence)
RecurrenceExceptionTableAdapter1.Fill(PlannerDataSet.RecurrenceException)
RecurrenceExceptionsTableAdapter1.Fill(PlannerDataSet.RecurrenceExceptions)

_calendar.LoadFromDataSource()

_calendar.BeginInit()

  Dim c As Contact
For Each c In _calendar.Schedule.Contacts
      _calendar.Contacts.Add(c)
Next

Dim r As Resource
For Each r In _calendar.Resources
       _calendar.Resources.Add(r)
Next

Dim a As MindFusion.Scheduling.Appointment
For Each a In _calendar.Schedule.Items
      _calendar.Schedule.Items.Add(a)
Next

_calendar.EndInit()

_calendar.GroupType = MindFusion.Scheduling.WinForms.GroupType.GroupByResources

'_calendar.Invalidate()

End Sub

I would be very gratefull if you can give my a help! tks!


« Last Edit: Aug 29th, 2011 at 2:43am by manobra »  
Back to top
 
IP Logged
 
Meppy
God Member
*****
Offline


MindFusion support

Posts: 1783
Joined: Jul 20th, 2005
Re: LoadFromDataSource + Resources = not shown
Reply #1 - Aug 29th, 2011 at 5:58am
Print Post  
Hi,

The following code block looks suspicious:

Code
Select All
Dim r As Resource
For Each r In _calendar.Resources
    _calendar.Resources.Add(r)
Next 


Try changing the above code like this:

Code
Select All
Dim r As Resource
For Each r In _calendar.Schedule.Resources
    _calendar.Resources.Add(r)
Next 


The idea is that after load, the loaded resources are located in the Calendar.Schedule.Resources collection and in order to reestablish grouping by the loaded resources, they need to be reselected in the Calendar.Resources collection.

Let me know if this helps.

Regards,
Meppy
  
Back to top
 
IP Logged
 
manobra
YaBB Newbies
*
Offline


I love YaBB 1G - SP1!

Posts: 2
Joined: Aug 29th, 2011
Re: LoadFromDataSource + Resources = not shown
Reply #2 - Aug 29th, 2011 at 6:22pm
Print Post  
Great Great Great Meppy!

Thank you for your fast reply as always!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint