This is a migrated thread and some comments may be shown as answers.

AppointmentsSource not showing in the control

13 Answers 80 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Christie Admin
Top achievements
Rank 1
Christie Admin asked on 29 Jan 2014, 09:52 PM
Hi,

I use a WeekView definition, I set the FirstDayOfWeek to Monday and the VisibleDays to 5 to see only Monday to Friday. I add 5 appointments, 1 for each day of the week. If my computer datetime is different than Sunday, all my appointments are visible in the control. If my computer datetime is on Sunday, no one are visible in the control!!!

Thank's
Alain

13 Answers, 1 is accepted

Sort by
0
Rosi
Telerik team
answered on 31 Jan 2014, 02:21 PM
Hi,

I suggest you check whether the generated appoinments dates are in the visible range of RadScheduleView.

If this does not help and the problem continues to persist,  please send us your code to review it and give you more instructions.

Regards,
Rosi
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Christie Admin
Top achievements
Rank 1
answered on 03 Feb 2014, 01:58 PM
Ho Rosi,

just try it with your online demo. Set your computer date to a sunday and try using the weekviewdefinition. Setting your computer to any other week day cause the demo to display the appointments but when you set it to a sunday, nothing are visible.

Thank's
Alain
0
Kalin
Telerik team
answered on 05 Feb 2014, 10:03 AM
Hi Alain,

I tried to reproduce the explained issue but not avail. I tested it in our online Silverlight demos - with the Appointment Template example. I'm attaching a video which shows my test - check it and let me know if I'm missing anything here.

I'm looking forward to your response

Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Christie Admin
Top achievements
Rank 1
answered on 06 Feb 2014, 12:47 PM
Hi Kalin,

I can reproduce it easily with your WPF online demo... Set your computer to a sunday, go in the FirstLook example of the scheduleview control, click on the week view definition. Nothing was shown... Go on an another control, set your computer date to any other day than a sunday, go back on the first look example of the scheduleview, click on the week view definition button, now you can see data.

Alain
0
Kalin
Telerik team
answered on 11 Feb 2014, 11:51 AM
Hi Alain,

I successfully managed to reproduce the described issue. After further investigation appears that the LoadAppointmentsSource is not calculating correctly the the first day of the week and when is Sunday it moves the Appointments to the next week. However we will fix the demo as soon as possible, for now you can use the modified method below:

protected static IEnumerable<T> LoadAppointmentsSource(Uri appointmentsSource)
{
    if (appointmentsSource != null)
    {
#if WPF
        IEnumerable<T> appointments = Application.LoadComponent(appointmentsSource) as IEnumerable<T>;
#else
        string text = new System.IO.StreamReader(Application.GetResourceStream(appointmentsSource).Stream).ReadToEnd();
        ObservableCollection<T> appointments = System.Windows.Markup.XamlReader.Load(text) as ObservableCollection<T>;
#endif
        DateTime firstDate = appointments.Min(new Func<T, DateTime>(GetStart));
        DayOfWeek firstDay = CultureInfo.CurrentCulture.DateTimeFormat.FirstDayOfWeek;
 
        var dayDifference = (int)DateTime.Today.DayOfWeek - (int)firstDay;
        dayDifference = dayDifference >= 0 ? dayDifference : DateTimeFormatInfo.CurrentInfo.DayNames.Length + dayDifference;
 
        DateTime firstDayOfCurrentWeek = DateTime.Today.Subtract(TimeSpan.FromDays(dayDifference));
        TimeSpan offset = firstDayOfCurrentWeek - firstDate;
        foreach (IAppointment appointment in appointments)
        {
            appointment.Start += offset;
            appointment.End += offset;
        }
 
        return appointments;
    }
 
    return Enumerable.Empty<T>();
}

Hope this helps. I have also updated you Telerik points for the involvement.

Regards,
Kalin
Telerik

Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).

0
Christie Admin
Top achievements
Rank 1
answered on 11 Feb 2014, 09:38 PM
Hi Kalin,

where should I use the provided protected method???

Thank's
Alain

0
Kalin
Telerik team
answered on 13 Feb 2014, 02:59 PM
Hi Alain,

I'm sorry for the misunderstanding, I thought you are using the same approach in your application as the one used in the demo. The mentioned method is located in the ExampleViewModel.cs file of the online example and it is causing the explained issue. If you are not using the same approach you shouldn't have the issue present. So if your case is different I'll ask you to provide us with more details on the ScheduleView implementation, sharing some sample code would be really helpful.

I'm looking forward to your reply.

Regards,
Kalin
Telerik

Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).

0
Christie Admin
Top achievements
Rank 1
answered on 14 Feb 2014, 09:02 PM
Hi Kalin,

no, I refered to the demo just as a reference. I use a collection of object and I assign it to the AppointmensSouce member of the control.

Thank's
Alain
0
Kalin
Telerik team
answered on 19 Feb 2014, 12:20 PM
Hello Alain,

We are not able to reproduce the described issue outside of the example. What I'm going to ask you is to open a support ticket with a sample project attached and also include information about the used version of the controls, so we can reproduce the issue on our side.

Hope this helps.

Regards,
Kalin
Telerik
0
Christie Admin
Top achievements
Rank 1
answered on 19 Feb 2014, 01:09 PM
Hi Kalin,

you just have to set the date of your pc on a sunday and add a collection of objects to the AppointmentsSource of the ScheduleView. Nothing should be visible in the ScheduleView... The same pattern work well if the date of your pc is set on any other day than a sunday.

Thank's
Alain
0
Rosen Vladimirov
Telerik team
answered on 20 Feb 2014, 11:19 AM
Hello Alain,

Your ticket came to my attention as it looks like there is some kind of confusion or misunderstanding. I've read all of the messages and I would like to clarify the problem and what could be causing it. Your explanation seems clear enough and as a matter of fact I've tried to reproduce the issue, but without success. I'm sending you my test project and a short video showing my steps. Could you take a look at them - maybe I've missed something? If you are able to reproduce the issue with the project I've sent you, could you give us more details for the exact version of Telerik UI for WPF that you are using and the Culture that's set on your machine.

If the issue is not reproducible with the attached project, could you modify it and send it back to us, so we'll be able to investigate it further. We'll be glad to assist you further, but we'll need more information on your scenario.

I'm looking forward to hearing from you.

Regards,
Rosen Vladimirov
Telerik
0
Christie Admin
Top achievements
Rank 1
answered on 20 Feb 2014, 01:59 PM
Hi Rosen,

I can compile your project but when I try to execute it, I receive the following error message :

System.Windows.Markup.XamlParseException occurred
  HResult=-2146233087
  Message=La valeur fournie sur 'System.Windows.Markup.StaticResourceHolder' a levé une exception.
  Source=PresentationFramework
  LineNumber=0
  LinePosition=0
  StackTrace:
       à System.Windows.Markup.WpfXamlLoader.Load(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings settings, Uri baseUri)
       à System.Windows.Markup.WpfXamlLoader.LoadDeferredContent(XamlReader xamlReader, IXamlObjectWriterFactory writerFactory, Boolean skipJournaledProperties, Object rootObject, XamlObjectWriterSettings parentSettings, Uri baseUri)
       à System.Windows.ResourceDictionary.CreateObject(KeyRecord key)
       à System.Windows.ResourceDictionary.OnGettingValue(Object key, Object& value, Boolean& canCache)
       à System.Windows.ResourceDictionary.OnGettingValuePrivate(Object key, Object& value, Boolean& canCache)
       à System.Windows.ResourceDictionary.GetValueWithoutLock(Object key, Boolean& canCache)
       à System.Windows.ResourceDictionary.GetValue(Object key, Boolean& canCache)
       à System.Windows.ResourceDictionary.GetValueWithoutLock(Object key, Boolean& canCache)
       à System.Windows.ResourceDictionary.GetValue(Object key, Boolean& canCache)
       à System.Windows.ResourceDictionary.FetchResource(Object resourceKey, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference, Boolean canCacheAsThemeResource, Boolean& canCache)
       à System.Windows.FrameworkElement.FindResourceInternal(FrameworkElement fe, FrameworkContentElement fce, DependencyProperty dp, Object resourceKey, Object unlinkedParent, Boolean allowDeferredResourceReference, Boolean mustReturnDeferredResourceReference, DependencyObject boundaryElement, Boolean isImplicitStyleLookup, Object& source)
       à System.Windows.FrameworkElement.FindImplicitStyleResource(FrameworkElement fe, Object resourceKey, Object& source)
       à System.Windows.FrameworkElement.GetRawValue(DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry& entry)
       à System.Windows.FrameworkElement.EvaluateBaseValueCore(DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry& newEntry)
       à System.Windows.DependencyObject.EvaluateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry newEntry, OperationType operationType)
       à System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
       à System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
       à System.Windows.FrameworkElement.UpdateStyleProperty()
       à System.Windows.FrameworkElement.OnInitialized(EventArgs e)
       à Telerik.Windows.Controls.ScheduleViewBase.OnInitialized(EventArgs e) dans c:\TB\105\WPF_Scrum\Release_WPF\Sources\Development\Controls\ScheduleView\ScheduleView\Controls\ScheduleView.Common.cs:ligne 1921
  InnerException: System.IO.FileLoadException
       HResult=-2146234304
       Message=Impossible de charger le fichier ou l'assembly 'Telerik.Windows.Controls, Version=2013.3.1204.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7' ou une de ses dépendances. La définition trouvée du manifeste de l'assembly ne correspond pas à la référence de l'assembly. (Exception de HRESULT : 0x80131040)
       Source=mscorlib
       FileName=Telerik.Windows.Controls, Version=2013.3.1204.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7
       FusionLog==== Informations d'état de liaison préalable ===
JRN : DisplayName = Telerik.Windows.Controls, Version=2013.3.1204.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7
 (Fully-specified)
JRN : Appbase = file:///C:/Users/agosselin/Desktop/ScheduleViewCurrentDate/bin/Debug/
JRN : PrivatePath initial = NULL
Assembly appelant : PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35.
===
JRN : cette liaison démarre dans le contexte de chargement de default.
JRN : utilisation du fichier de configuration de l'application : C:\Users\agosselin\Desktop\ScheduleViewCurrentDate\bin\Debug\ScheduleViewWPF.vshost.exe.Config
JRN : utilisation du fichier de configuration d'hôte :
JRN : utilisation du fichier de configuration de l'ordinateur à partir de C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
JRN : référence post-stratégie : Telerik.Windows.Controls, Version=2013.3.1204.40, Culture=neutral, PublicKeyToken=5803cfa389c90ce7
JRN : tentative de téléchargement de la nouvelle URL file:///C:/Users/agosselin/Desktop/ScheduleViewCurrentDate/bin/Debug/Telerik.Windows.Controls.DLL.
AVT : la comparaison du nom de l'assembly a entraîné l'incompatibilité : Numéro de révision
ERR : impossible de terminer l'installation de l'assembly (hr = 0x80131040). Détection terminée.

       StackTrace:
            à System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type)
            à System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
            à System.Reflection.Assembly.GetType(String name, Boolean throwOnError)
            à System.Windows.Baml2006.Baml2006SchemaContext.ResolveBamlTypeToType(BamlType bamlType)
            à System.Windows.Baml2006.Baml2006SchemaContext.ResolveBamlType(BamlType bamlType, Int16 typeId)
            à System.Windows.Baml2006.Baml2006SchemaContext.GetXamlType(Int16 typeId)
            à System.Windows.Baml2006.Baml2006SchemaContext.GetProperty(Int16 propertyId, XamlType parentType)
            à System.Windows.Baml2006.Baml2006Reader.Process_PropertyWithConverter()
            à System.Windows.Baml2006.Baml2006Reader.Process_OneBamlRecord()
            à System.Windows.Baml2006.Baml2006Reader.ReadObject(KeyRecord record)
            à System.Windows.ResourceDictionary.CreateObject(KeyRecord key)
            à System.Windows.ResourceDictionary.OnGettingValue(Object key, Object& value, Boolean& canCache)
            à System.Windows.ResourceDictionary.OnGettingValuePrivate(Object key, Object& value, Boolean& canCache)
            à System.Windows.ResourceDictionary.GetValueWithoutLock(Object key, Boolean& canCache)
            à System.Windows.ResourceDictionary.GetValue(Object key, Boolean& canCache)
            à System.Windows.DeferredResourceReference.GetValue(BaseValueSourceInternal valueSource)
            à System.Windows.StaticResourceExtension.TryProvideValueInternal(IServiceProvider serviceProvider, Boolean allowDeferredReference, Boolean mustReturnDeferredResourceReference)
            à System.Windows.StaticResourceExtension.ProvideValueInternal(IServiceProvider serviceProvider, Boolean allowDeferredReference)
            à System.Windows.StaticResourceExtension.ProvideValue(IServiceProvider serviceProvider)
            à MS.Internal.Xaml.Runtime.ClrObjectRuntime.CallProvideValue(MarkupExtension me, IServiceProvider serviceProvider)
       InnerException:

Thank's
Alain
0
Rosen Vladimirov
Telerik team
answered on 21 Feb 2014, 01:12 PM
Hello Alain,

It looks like there is a problem in the referenced assemblies - could you verify that all of them are the same version? It looks like one of them is from 2013.3.1204.40 version, while the others are not.

Hope this helps.

Regards,
Rosen Vladimirov
Telerik
Tags
ScheduleView
Asked by
Christie Admin
Top achievements
Rank 1
Answers by
Rosi
Telerik team
Christie Admin
Top achievements
Rank 1
Kalin
Telerik team
Rosen Vladimirov
Telerik team
Share this question
or