MajorTickLength and MinorTickLength Property Not set

10 posts, 0 answers
  1. hardik
    hardik avatar
    57 posts
    Member since:
    Feb 2011

    Posted 28 Mar 2011 Link to this post

    Hi telerik,

    I have seen one of your post. Into that from xaml majorticklength propoerty for timeline view is set to "12h".so 12 hour difference is set.

    Same thing I had done for day view.Its working fine.

    But my requirement is I want to set the time in minutes.

    So I guess for minutes it should "10m", but its not works,

    This is provided by schedulerView?

    Because this is my basic requirement.I want timeslots with 5 minute interval.And its provided than its very helpful to me..How can I set this please reply me as early as possible.

    Thanks
    Hardik Pancholi
  2. Sami
    Sami avatar
    8 posts
    Member since:
    Nov 2010

    Posted 29 Mar 2011 Link to this post

    Hi,

    ScheduleView view definitions can be done in xaml or in code. Here is simple example how to define day and week definitions by xaml and by code.

    In XAML:
    <scheduleView:RadScheduleView x:Name="XamlRadScheduler">
      <telerik:RadScheduleView.ViewDefinitions>
        <telerik:DayViewDefinition DayStartTime="8:00:00" MajorTickLength="1h" MinorTickLength="5min" />
        <telerik:WeekViewDefinition DayStartTime="8:00:00" MajorTickLength="1h" MinorTickLength="5min"  />
      </telerik:RadScheduleView.ViewDefinitions>
    </scheduleView:RadScheduleView>

    In code:
    DayViewDefinition dayView = new DayViewDefinition();
    dayView.DayStartTime = new TimeSpan(0, 8, 0, 0, 0);
    dayView.MinorTickLength = new FixedTickLengthProvider(new TimeSpan(0, 0, 5, 0, 0));
    dayView.MajorTickLength = new FixedTickLengthProvider(new TimeSpan(0, 1, 0, 0, 0));
    this.XamlRadScheduler.ViewDefinitions.Add(dayView);
      
    WeekViewDefinition weekView = new WeekViewDefinition();
    weekView.DayStartTime = new TimeSpan(0, 8, 0, 0, 0);
    weekView.MinorTickLength = new FixedTickLengthProvider(new TimeSpan(0, 0, 5, 0, 0));
    weekView.MajorTickLength = new FixedTickLengthProvider(new TimeSpan(0, 1, 0, 0, 0));
    this.XamlRadScheduler.ViewDefinitions.Add(weekView);

    I hope this helps.

    Best regards,
    Sami
  3. DevCraft banner
  4. Hubert Frick
    Hubert Frick avatar
    8 posts
    Member since:
    Nov 2009

    Posted 12 Apr 2011 Link to this post

    Hi,
    I am migrating from RadScheduler to RadScheduleView because of several Advantages in Showing Group Resources. In my Application I need only the TimelineView and also I need only 1 timeslot per day.
    I tried to set the parameters in my TimelineViewDefinition via xaml, but modifying the property MinorTickLengt on a value over 12 hours doesn't work.
    For example I  tried to set the Xaml Code like this:
    <scheduleView:RadScheduleView  x:Name="scheduleView" DataContext="{StaticResource ViewModel}" GroupHeaderContentTemplateSelector="{StaticResource GroupHeaderContentTemplateSelector}"
                                        AppointmentsSource="{Binding Appointments}"
                                        SpecialSlotStyleSelector="{StaticResource SpecialSlotStyleSelector}"
                                        SpecialSlotsSource="{Binding SpecialSlots}" 
                                        ResourceTypesSource="{StaticResource ResourceTypes}"
                                        VerticalAlignment="Stretch"
                                        FirstDayOfWeek="Monday">
                <telerik:RadScheduleView.ActiveViewDefinition>
                    <telerik:TimelineViewDefinition x:Name="activetimelineViewDefinition"
                                                    VisibleDays="31" LargeChangeInterval="14d" SmallChangeInterval="7d"
                                                    TimerulerGroupStringFormat="{}{0:dd-MM}"
                                                    TimerulerMajorTickStringFormat=""
                                                    TimerulerMinorTickStringFormat=""
                                                    MajorTickLength="24h"
                                                    MinorTickLength="24h"
                                                    StretchGroupHeaders="True"/>
                </telerik:RadScheduleView.ActiveViewDefinition>

    I also tried to set on the property MinorTickLength on "1d" ..., and I tried to set DayStartTime and DayEndTime on 0:00:00 and so on.
    Then, fortunately I found this forum post and read how to set the Properties via C#. I tried to set the values after InitializeComponent() :
    this.InitializeComponent();
    this.activetimelineViewDefinition.MinorTickLength = new FixedTickLengthProvider(new TimeSpan(1, 0, 0, 0, 0));
    this.activetimelineViewDefinition.MajorTickLength = new FixedTickLengthProvider(new TimeSpan(1, 0, 0, 0, 0));

    This works fine as expected and solved my problem! But why does'nt it accept values over 12h for MinorTickLength in xaml?

    Thanks
    Hubert Frick
  5. Rosi
    Admin
    Rosi avatar
    2527 posts

    Posted 18 Apr 2011 Link to this post

    Hello Hubert,

    This is a limitation of RadScheduleView that we will do our best to improve for the next version of the control. We are sorry for any inconvenience that this causes to you.

    Kind regards,
    Rosi
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  6. Håkan
    Håkan avatar
    183 posts
    Member since:
    May 2011

    Posted 23 Jun 2011 Link to this post

    I have the same requirements, only one slot per day...
    Would be nice to set in XAML.

    Regards,
    Håkan
  7. Supreet
    Supreet avatar
    19 posts
    Member since:
    Mar 2011

    Posted 01 Aug 2011 Link to this post

    Hi Team,
       Is it possible to have time slots of 50 with mins each ScheduleView?
    it should show up like 

    10:00 AM
    10:50 AM
    11:40 AM
    12:30 PM like so..

    Thanks & Regards
    Supreet
  8. Hubert Frick
    Hubert Frick avatar
    8 posts
    Member since:
    Nov 2009

    Posted 01 Aug 2011 Link to this post

    Hi Supreet,
    it doesn't seem you can set this special timeslot in xaml, but perhaps it could be a solution for you, if you try to set your viewdefinition in your code behind like this:

    this.activeViewDefinition.MinorTickLength = new FixedTickLengthProvider(new TimeSpan(0, 0, 50, 0, 0));
    this.activeViewDefinition.MajorTickLength = new FixedTickLengthProvider(new TimeSpan(0, 0, 50, 0, 0));

    Hope this helps you!

    Regards
    Hubert
  9. Supreet
    Supreet avatar
    19 posts
    Member since:
    Mar 2011

    Posted 01 Aug 2011 Link to this post

    Hello Hubert,
         Thanks for your reply.
      I think that will work as you are setting the Min property of the Time Span object.
    I have one more question. Will it also be possible to have certain time slots reserved where appointments can not be created & it has a small time period.
    e.g.
    10:00AM (50 mins lecture)
    10:50AM (50 mins lecture)
    11:40AM (50 mins lecture)
    12:30PM (50 mins lecture)
    13:10PM (40 mins LUNCH BRAEK)
    14:00PM (50 mins lecture)
    14:50PM (50 mins lecture)  & So on So forth..
    I am not sure if this is really possible.
    Kindly update.

    Thanks & Regards
    Supreet
  10. Hubert Frick
    Hubert Frick avatar
    8 posts
    Member since:
    Nov 2009

    Posted 02 Aug 2011 Link to this post

    Hi Supreet,
    I don't think you can do this, without customizing your ScheduleView-Template. If this is too expensive for you, you should think about setting your MajorTickLength to 1 hour, your MinorTickLength to 10 min. In  this demo you can try out this aproach. Could be that this, in combiation with Special and ReadOnly Slots, could be a possible solution for you?

    Regards
    Hubert
  11. Supreet
    Supreet avatar
    19 posts
    Member since:
    Mar 2011

    Posted 02 Aug 2011 Link to this post

    Thanks Hubert,
       I will try that & will update my findings here :)
    Regards
    Supreet
Back to Top
DevCraft banner