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

Special slots side by side

11 Answers 116 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Roei
Top achievements
Rank 1
Roei asked on 01 Aug 2011, 08:43 AM
Hi 
1. I need to show 2 slots in the same time side by side. The current situation is that if 2 slots have the same times one is shown on top of the 
other and not side by side like in Appointment.

2. I share the same problem as mentioned in earlier post "Tool Tips on Special Slots" thread started by Michael Lilly
http://www.telerik.com/community/forums/silverlight/scheduleview/tool-tips-on-special-slots.aspx


Thanks in advance

Roei

11 Answers, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 01 Aug 2011, 11:46 AM
Hi Roei,

Straight to the answers:
1) This feature is not available yet. It is in our plans for development and you cannot achieve it with customization.
2) We will do our best to deliver a way to display a tooltip on a special slot in one of the upcoming service packs of RadControls for Silverlight/WPF. Currently you cannot achieve this behavior through customization.

Best wishes,
Valeri Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Roei
Top achievements
Rank 1
answered on 01 Aug 2011, 03:54 PM
Hi Valery!

I got your point and we'll wait for news in the upcoming releases.
meanwhile maybe you can help me with a workaround.
I need to show an Appointment which has sub-task that fill it.
 for example:
Appointment  A start time is 09:00
task1 - 09:00- 10:00
task2 - 10:00 - 11:00
task3 - 11:00-  12:00
* the number of sub task is dynamic and not static!
Appointment  A end time is 12:00

I need a way to style the task with different colors so they will fill the appointment height and stretch if i change the time ruler.

Thanks in advance

Roei
0
Valeri Hristov
Telerik team
answered on 02 Aug 2011, 08:39 AM
Hello Roei,

I am afraid that RadScheduleView cannot automatically split its appointments into parts as per your requirement. We didn't received similar requests before, would it be possible to share the business logic behind?

Best wishes,
Valeri Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Roei
Top achievements
Rank 1
answered on 02 Aug 2011, 09:01 AM
Yes of course,

We are in the irrigation controllers industry.
Our application manage the remote controller so the user can setup up his irrigation and then send it to the remote device.
The Irrigation logic is as follow:
Irrigation Program (can be WEEKLY type means that the user can set the days he wants to irrigate and CYCLIC means by days interval e.g every 2 days, 5 days 14 days etc):
Program has a start & end time (the end time is usually calculated) and a set of vavles 1-n the operate one after the other.
Each valve has a duration time.

Lets take a sample irrigation program scenario:
Program A - start time 08:00
Valve1 - start time 08:00 - end time 09:00
Valve2 start at 09:00 - 11:00
Valve 3 start at 11:00 - 14:00

Program A end time will be: 14:00

So the question here is what object model is the Appointment: Program or Valve?
1. In the begging i started with program as appointment but didn't manage to style the valves in different colors and to set their height dynamically.
2. When i found out the special slots i thought the i'll use slots for programs and appointment for valves in that way i can set a style to the slot and place the valves (appointment) on top with their on style, this is working fine until the case where 2 program operate on the same time.

See attached screenshots:
in image 2 you can see that the slot color of program A hides the color of Program B since they operate in the same time

Thanks

Roei



0
Valeri Hristov
Telerik team
answered on 04 Aug 2011, 03:06 PM
Hello Roei,

Thank you for the detailed description of your requirements. I am afraid that you need much complex feature than simple side-by-side rendering of the slots - you actually need to associate special slots to appointments, that somewhat makes the data hierarchical. Even if we allow side by side rendering for Slots (we actually would like to do this for Q3) it will not be easy to tell which slot under which appointments should be rendered, simply because currently the slots and the appointments are completely different things that are not related to each other.

We will be working on hierarchy, though, so we will definitely have hierarchical appointments some day in the near future. I cannot say if we will be able to add ability to render appointments one over another for Q3 2011, but I think this feature is good and we will have it sooner or later.

Kind regards,
Valeri Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Roei
Top achievements
Rank 1
answered on 04 Aug 2011, 03:19 PM
Hi (again) Valeri

Since we're on tight schedule(view) :-). I need to work this thing out now.
What i'm thinking of is to leave special slots for no, at least until you'll add this feature.
And meanwhile i'll render Program as appointments (as i did before) and by edit the appointment template to pass a list of valves which will be drawn with different colors and by that fill the entire appointment area. I can calculate the relative height in % for each of the valves
So i just need a way to get the actual height of the appointment (until now i didn't manage to do this) and then by using stack panel to place all the valves.

Here is the data template i have so far:
I just need a way to dynamically set the valves relative height:
<DataTemplate x:Key="AppointmentTemplate">
                <Grid x:Name="app1" d:DesignWidth="240" d:DesignHeight="88" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
 
                    <Border BorderBrush="Black" CornerRadius="6,6,0,0">
 
                        <TextBlock Text="{Binding Subject, FallbackValue=Prog Symbol}" FontSize="13" Foreground="Black" HorizontalAlignment="Center" />
                    </Border>
 
 
                    <ItemsControl Grid.Row="1" x:Name="valveAppointment" ItemsSource="{Binding Appointment.IrrigatingValves}" Margin="0" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" Foreground="{x:Null}" >
 
                        <ItemsControl.ItemsPanel>
                            <ItemsPanelTemplate>
                                <StackPanel x:Name="sp1" Orientation="Vertical"  HorizontalAlignment="Stretch" VerticalAlignment="Stretch"/>
 
                            </ItemsPanelTemplate>
                        </ItemsControl.ItemsPanel>
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <Border BorderThickness="1" BorderBrush="#FFA13030">
                                    <StackPanel  Orientation="Horizontal"  d:DesignWidth="264" d:DesignHeight="32" Height="{Binding ValveProportion}" Margin="1">
                                        <TextBlock x:Name="ValveName" Text="{Binding ValveConfig.Name, FallbackValue='v name'}" HorizontalAlignment="Center" VerticalAlignment="Top" Foreground="Black" FontStretch="Condensed" />
                                        <TextBlock x:Name="ValveAmount" Text="{Binding AmountString, FallbackValue='amount'}" VerticalAlignment="Center" Margin="2,0,0,0" FontStretch="Condensed" Visibility="Collapsed">
 
                                        </TextBlock>
 
                                    </StackPanel>
                                </Border>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
 
                    </ItemsControl>
 
                </Grid>
            </DataTemplate>-->

 Thanks 

Roei
0
Valeri Hristov
Telerik team
answered on 04 Aug 2011, 03:31 PM
Hi Roei,

I have an idea, but I didn't tried it, so I am not sure if it will work - instead of StackPanel, you could use a Grid panel for ItemsPanel of the ItemsControl. You could bind the RowDefinitions of this Grid to the property that contains information about the proportions of the valves through a IValueConverter, that will create RowDefinition for each valve with the corresponding number of * (star) that represent the proportional size of this valve. Then you should create a class, deriving from ItemsControl and inside the PrepareContainerForOverride method set the Grid.Row attached property on the items, so that each item will go to its corresponding row. This way the Grid panel will automatically stretch the valve elements according their relative sizes and you will not need to know the size of the AppointmentItem.

Please, let me know if you need additional information.

All the best,
Valeri Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Roei
Top achievements
Rank 1
answered on 04 Aug 2011, 03:35 PM
Its sounds a great solution, a sample code will be more than welcome!!!

Thanks in advance

Roei
0
Konstantina
Telerik team
answered on 10 Aug 2011, 07:38 AM
Hello Roei,

We do not have an example project at the moment and we will need more time to prepare it.
Meanwhile, give Valeri's suggestion a try and let us know if you have any particular questions.

Regards,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
0
Roei
Top achievements
Rank 1
answered on 10 Aug 2011, 08:01 AM
Hi Konstantina 

There is no need for example anymore!
I managed to solve my problem using the tip i got from Valeri and a sample i found on the web regarding inheriting from ItemsControl
http://www.silverlightshow.net/items/How-to-inherit-from-ItemsControl-and-create-a-UniformGrid-with-containers.aspx
I took the capabilities i needed from the sample above and inherit from telerik's  ItemsControl instead of the regular one in order to get the style selector.
Attached is the result i got.

Thanks for your help ans support,especially to Valeri :-) 
Roei
0
Konstantina
Telerik team
answered on 11 Aug 2011, 09:03 AM
Hello Roei,

We are glad that you have resolved the issue yourself.

Your solution may be very useful for other forum users. Would you like to prepare a KB article and share it? For any successful KB article we grand Telerik points.

Thank you in advance.

Regards,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
Tags
ScheduleView
Asked by
Roei
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Roei
Top achievements
Rank 1
Konstantina
Telerik team
Share this question
or