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

Day and week View not looks properly

10 Answers 300 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
hardik
Top achievements
Rank 1
hardik asked on 25 Mar 2011, 02:04 PM
Hi support,

I am using scheudlerView for one test project. It behaves very differently.(See Image).

As per my requirement i want to know currenlty I am in which View(day,week,month) . In scheudler control I can check the view by using ActiveViewDefinitionChanged event.In this new control I am not getting such events. Also i don't have property like ViewMode which is already in scheduler.

If i want to set week view as default view than what i have to  do? Why you remove all these properties and events?

One important thing. If i want to set time ruler than how can i set it?

Like if timeslotlength property in scheudler which is not here in scheudlerView.If i set timelsotlenght to 10 minutes than hour is divided into 6 different slots.But there is one problem time is not divided as per that. so user is not able to identify in which time he had clicked...I think for showing time 12:10,12:20,12:30 etc...You have solved this issue..

Now i want to know from .cs file how can i set timeslotlength like property.

Thanks
Hardik

10 Answers, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 25 Mar 2011, 02:31 PM
Hello Hardik,

As far as I can see, the StretchGroupHeaders property on the view definitions is set to false, hence they do not ocupy the whole width of the control. Please, let me know if I this is not the unexpected behavior that you are asking for.

Why do you need to know which is the current view? If you are loading the appointments on demand you could check the following example:
http://demos.telerik.com/silverlight/#ScheduleView/LoadOnDemand

To set the active view from outside you should use the ActiveViewDefinitionIndex property on RadScheduleView. This is the index of the desired view definition in the ViewDefinitions collection. This property could be used to determine what is the current view definition too.

To configure the time ruler tick frequency you should use the Minor/MajorTickLength properties on each ViewDefinition. Here is an example:
http://demos.telerik.com/silverlight/#ScheduleView/TickFrequencyAndZoom

Kind regards,
Valeri Hristov
the Telerik team
0
hardik
Top achievements
Rank 1
answered on 28 Mar 2011, 06:42 AM
Hi Telerik,

Thanks for early reply.. As i set StretchGroupHeaders = true.But still I get the same problem as i mentation earlier.

And for the ActiveViewDefinationIndex. If I set ActiveViewdefinationIndex = 1 at load time.Then week view should open.But it's not happen.by default only day view is open.

For the time ruler issue I see the example from demo.But from that I am not able to get how I will set my logic into that.
Actually in schedulre I only need to set timeSlotLenght property And as per that slots are divided.But in scheudler View example you have used radcombobox and in that You set slider to set the slots..But my requirement is If I set value to 10 then slots should divided as per that and also time also shown in 10 min internal.

Can you please tell me any property of scheudlerView which directly affect the timeslots .

Thanks

Hardik Pancholi
0
George
Telerik team
answered on 31 Mar 2011, 08:45 AM
Hello Hardik,

We will greatly appreciate a sample project of yours. It will definitely help us in further pinpointing and resolving the problem. Can you attach the sample project to this thread? 

 
Regards,
George
the Telerik team
0
PaulH
Top achievements
Rank 1
answered on 01 Apr 2011, 12:19 AM
Hi there

I'm currently evaluating the Silverlight controls in a new project I am working on and I am having the same problem with the width of the day view and week view definitions. I can control which view is selected by using the ActiveViewDefinitionIndex incidentally.

I have set the StretchGroupHeaders on both day and week view definitions but the header does not change in width. My RadScheduleView is in a standard Windows Silverlight TabControl TabItem. My TabControl sits in a grid and the TabControl itself is set to have a HorizontalAlignment of Stretch. The TabControl itself takes up the full width and the RadScheduleView itself is taking up the full width of the tab but the view definitions are just not stretching across the RadScheduleView. XAML of my TabItem with the TabControl definition below. Prior to placing it in a TabControl it sat inside the grid itself and I had the same symptoms. I also tried putting it into a StackPanel. If I forced the Width of the RadScheduleView to a value - say 1000 - then the day and week views appeared to stretch correctly BUT each time I switched to the day view or the week view I got an error stating that a value could not be infinity, a negative value or NaN though I don't have the exact error. Any thoughts? (I am using the latest version downloaded just last week and it's the only version I've had on my development machine so I know it's the correct one)
                       
<sdk:TabControl Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="5">
    <sdk:TabItem x:Name="ScheduleTab"
         Header="Schedule"
         >
 
        <telerik:RadScheduleView Name="radScheduleView"
                                 AppointmentsSource="{Binding ScheduleItems}"
                                 ActiveViewDefinitionIndex="1"
                                 >
 
            <telerik:RadScheduleView.ViewDefinitions>
                <telerik:DayViewDefinition DayStartTime="{Binding DayStartTime.Value}"
                                           DayEndTime="{Binding DayEndTime.Value}"
                                           StretchGroupHeaders="True"
                                           />
                <telerik:WeekViewDefinition DayStartTime="{Binding DayStartTime.Value}"
                                            DayEndTime="{Binding DayEndTime.Value}"
                                            StretchGroupHeaders="True"
                                            />
                <telerik:MonthViewDefinition />
 
            </telerik:RadScheduleView.ViewDefinitions>
        </telerik:RadScheduleView>
 
    </sdk:TabItem>
0
Mukesh
Top achievements
Rank 1
answered on 01 Apr 2011, 02:27 PM
hi,

I think Paul you are right. I have tested scheudelrView individually then it works fine for all functionality.

But when I use it in some container than it behaves very strangely

Thanks
Mukesh
0
Valeri Hristov
Telerik team
answered on 04 Apr 2011, 05:10 PM
Hello Paul, Mukesh,

Could you try with RadTabControl, instead of the SDK's TabControl? It is possible that the SDK control measures the ScheduleView with Infinity in one of the directions (this is evident from the behavior change when you set Width/Height on RadScheduleView).

Anyway, we will need some time to investigate this behavior, I will write again when I have more information, probably tomorrow. If there is a problem in RadScheduleView we will do our best to fix it for the upcoming service pack in two weeks.

Kind regards,
Valeri Hristov
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
0
PaulH
Top achievements
Rank 1
answered on 07 Apr 2011, 11:40 AM
I have spent some time working on this problem and the issue seems to be caused by the complexity of the containers that the RadScheduleView sits in. On one page my "LayoutRoot" was a Grid which contained a ScrollViewer around the entire content. This content then held further controls including a Grid and the RadScheduleView was in a row of the Grid contained in the ScrollViewer. Removing the ScrollViewer resolved the issue in this case. On another view I was loading a UserControl containing the RadScheduleView into the "LayoutRoot" Grid as a child element. I had to simplify the levels of controls in order to get the definitions to display correctly and to stop me getting an error with the control trying to size itself and reporting that a value could not be "infinity a negative or NaN". The majority of issues seem to come down to the control having various levels of parent controls. So if the page contains a Grid which contains StackPanels which themselves contain Grids and the RadScheduleView is sat in one of the lower level controls then the problem occurs. Unfortunately I don't have the time to tie down which controls cause the problem though based on past history I suspect the StackPanel is involved. I hope this may help a little with your testing. Clearly a RadScheduleView just contained in a Grid is fine and even in a TabControl within a Grid is fine. But if the parent control structure is more complicated than that then problems can occur.

Sorry I can't be more specific. For now at least I have resolved my issues by modifying the content of my views.
0
hardik
Top achievements
Rank 1
answered on 07 Apr 2011, 11:57 AM
Hi paul,

You are right as I remove scrollViewer from our all page then its working fine.NO problem with scheduleView.
But my requirement is like this only.I can't change my structure.

One grid into that 2 rows and 2 columns, IN first row 2 combo box, in second row first column tree view control and second row second column scheduleView.

What I have to do if I want both tree view and scheduleViewunder single scrollViewer.

Waiting for reply from telerik.

Thanks
Hardik
0
Ken
Top achievements
Rank 1
answered on 08 Apr 2011, 10:52 PM
Hello Valeri,

I'm trying bind the ActiveViewDefinitionIndex to a property residing in my view model so I can initially set the ScheduleView to day, week, or month view.  This does not seem to work.  It always starts in day view.  I have tried setting ActiveViewDefinitionIndex to 0,1, and 2 and that works fine but not my binding.  I also tried hard coding my property value in the constructor of the view model just to see if it would work but that did not work either.  Is the ActiveViewDefinitionIndex property bindable?

Here's my xaml code:
<scheduleView:RadScheduleView Grid.Row="0" x:Name="scheduler"
AppointmentsSource="{Binding Appointments}"
AppointmentItemContentTemplate="{StaticResource AppointmentTemplate}"
FirstDayOfWeek="Sunday"
ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Auto"
CurrentDate="{Binding CurrentDate}"
ActiveViewDefinitionIndex="{Binding ActiveViewIndex}"
SelectedAppointment="{Binding SelectedAppt}"
MinAppointmentWidth="150" MinWidth="900"
SnapAppointments="True">
 
<scheduleView:RadScheduleView.ViewDefinitions>
    <scheduleView:DayViewDefinition MinTimeRulerExtent="950" MajorTickLength="1h" MinorTickLength="30min" TimerulerMajorTickStringFormat="{}{0:htt}" />
    <scheduleView:WeekViewDefinition MinTimeRulerExtent="950" MajorTickLength="1h" MinorTickLength="30min" TimerulerMajorTickStringFormat="{}{0:htt}" />
    <scheduleView:MonthViewDefinition />
</scheduleView:RadScheduleView.ViewDefinitions>
</scheduleView:RadScheduleView>


Here's my property in the view model:
///<summary>
/// Initial view definition (day, week, month)
/// </summary>
private int _activeViewIndex;
public int ActiveViewIndex
{
    get { return _activeViewIndex; }
    set
    {
        _activeViewIndex = value;
        OnPropertyChanged("ActiveViewIndex");
    }
}


Thanks,
Ken
0
hardik
Top achievements
Rank 1
answered on 13 Apr 2011, 09:33 AM
Hi telerik,

Just for reminder Can you please give any suggestion as per requirement which I have already defined in early post.

In grid I want to use schedulView, comboBox and tree View.

I had fix the size of schedulView in grid with all controls. Then day Stretch problem is solved. But If I use same thing in another Computer than View not looks good, because that system resolution is different than mine.

What can be the solution for this problem. Please give any suggestion early.As I solve this problem than my team can think for buy new control. Currently I am using trial version.

Thanks
Hardik Pancholi
Tags
ScheduleView
Asked by
hardik
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
hardik
Top achievements
Rank 1
George
Telerik team
PaulH
Top achievements
Rank 1
Mukesh
Top achievements
Rank 1
Ken
Top achievements
Rank 1
Share this question
or