10 Answers, 1 is accepted
By design the GroupHeaders are always kept visible. Can you please share which ViewDefinition are you using and some more details regarding the exact requirements? If you have also share a screenshot or video of the observed behavior that would be really helpful.
Looking forward to hearing from you.
Regards,
Kalin
Telerik
See What's Next in App Development. Register for TelerikNEXT.
Hi Kalin,
I was able to get the scroll bar working for ScheduleView, but i am running into another issue, My screen is displaying multiple RadSchedule, please take a look at the ticket for some information (http://www.telerik.com/account/support-tickets/view-ticket.aspx?threadid=913448)
So i have a Itemscontrol and it displays RadSchedules. I want to have just one scrollbar for all the schedules and i am able to make it work by hiding the vertical scroll for all the schedules except for the last one.
When user scroll the last schedule time slots scrolls but the the other schedules do not, and that is expected, I am not able to figure out how to programatically scroll the other schedules.
RadSchedule does not have a ScrollChanged event.
Thanks
vikas
I understand your concern. What I can suggest you would be to hook to the Loaded event of RadScheduleView in order to get the needed ScrollBar from its Template. Then you can hook to the Scroll event of the ScrollBar and set the VerticalOffset of all ScheduleViews each time the event is raised. For example you can bind the VerticalOffset of all ScheduleViews to a property in the ViewModel and change it when needed. For example please check the following code snippet:
private
ScrollBar lastScroll;
private
void
RadScheduleView_Loaded(
object
sender, RoutedEventArgs e)
{
var scroll = (sender
as
RadScheduleView).Template.FindName(
"PART_VerticalScrollBar"
, sender
as
RadScheduleView)
as
ScrollBar;
if
(
this
.lastScroll !=
null
)
{
this
.lastScroll.Visibility = System.Windows.Visibility.Collapsed;
this
.lastScroll.Scroll -= scroll_Scroll;
}
this
.lastScroll = scroll;
this
.lastScroll.Scroll += scroll_Scroll;
}
void
scroll_Scroll(
object
sender, ScrollEventArgs e)
{
(
this
.DataContext
as
SchedulingTabVM).VerOffset = e.NewValue;
}
Hope this helps.
Regards,
Kalin
Telerik
See What's Next in App Development. Register for TelerikNEXT.
Hi Kalin,
I finally got some time to work on this, I am using the approach you mentioned, I have a property in my view model data bind to RadScheduleView Verticaloffset:
<scheduleView:RadScheduleView Grid.Row="1" ActiveViewDefinition="{Binding ActiveViewDefinition, Mode=OneWayToSource}" Width="200" VerticalOffset="{Binding RadScheduleViewVerOffset, Mode=OneWay}"
the getter for the property is called the first time i add the calendar, but after that when i scroll the offset does not change, I added some traces and the setter is getting called:
public double RadScheduleViewVerOffset
{
get
{
Console.WriteLine("getting offset for: " + _scheduleName); -- This gets called only for the first time
return _radScheduleViewVerOffset;
}
set
{
Console.WriteLine("Updating offset for: " + _scheduleName + " value: " + value);
_radScheduleViewVerOffset = value;
this.OnPropertyChanged("RadScheduleViewVerOffset");
}
}
I am bale to make it work by setting the offset directly on radscheduleView, but it will be good if i can accomplish this using data binding firstScheduleView.VerticalOffset = e.NewValue;
---------------------------------------------------------------------------------------------------------------------------------------------
I have running into one other problem, it is related to horizontal scrolling. As you know i am displaying multiple schedule views and i want just one scroll bar for them, All the schedules are inside a scroll viewer, I am using that scroll viewer only for horizontal scrolling (for vertical scrolling i am using the one that is part of the schedule view).
So this scroll viewer contains all the schedules + the time marker (which is attached to the first schedule), I am hiding time marker for the other schedule view, Now when i have multiple schedules and the horizontal scroll is visible I scroll and the schedules scorll along with that the time marker also scrolls and is out of view.
when users are trying to book an appointment for a schedule that is on the far right they will scroll to get to it but will not be able to see the time marker and hence wont know what time they are selecting for the appointment.
Is there any way to pin the time marker or is it possible to add just the time marker control with the schedule and scroll it vertically as the other schedules scroll
thanks
vikas
I'm afraid there isn't a straight forward solution for this behavior. What I can suggest you would be to place another ScheduleView outside of the ScrollViewer with time marker only visible (you would need to set Width=55 for example to be only the time ruler part visible). This way it will stay like frozen on the left while the user scrolling horizontally the ScheduleViews in the ScrollViewer.
Hope this will help you.
Regards,
Kalin
Telerik
thanks, it worked.
vikas
Hi Kalin,
One more question, As we discussed before i am hiding the scrollbar for all the schedules except for the last one and then setting the vertical offset of all the other schedules.
The problem that i am running into is that when there are several schedules and they out of the view I mean horizontally then i have to scroll to the right most schedule to use the vertical scrollbar but then i can not see the first or second schedule.
Basically i want a scrollviewer that contains all the schedules and i can scroll hotrizontally and vertically, I can achieve this by not using schedule scrollviewer at all and putting all the schedules in a separate scrollviewer but with that the problem is that the group headers go out of view when scrolling vertically.
I understand that this is not a standard functionality but wanted to see if you have any ideas.
Thanks
vikas
You can try to use the same approach as the one for the Timeruler. To use another ScheduleView with only its ScrollBar visible on the right side of the ScrollViewer with the other ScheduleViews.
Hope this will help you.
Regards,
Kalin
Telerik
that works.
vikas