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

Selected Resource swaps on Refresh

1 Answer 53 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Denis Cilliers
Top achievements
Rank 1
Denis Cilliers asked on 05 Jul 2013, 10:06 AM
Is there a way to select a resource and after refreshing the diary to jump back to the selected resource.

Currently if you select a resource and only have that resource filling the diary screen, if you refresh the diary using 

Me.rsScheduler.SchedulerElement.Refresh()

The selected resource is the first one in your resource list.

How would I return to the original resource in the diary

The scenario is as follows;
We have 5 pc's at the client 4 salesmen and 1 admin.  
Each pc sees the full diary with all 4 salesmen
They might want to filter to see just their appointments by setting the resource per view to 1 
This will show just one salesman on the diary
When the diary is refreshed it defaults to the first salesman and on the original selected one
 

1 Answer, 1 is accepted

Sort by
0
Ivan Petrov
Telerik team
answered on 10 Jul 2013, 10:08 AM
Hello Denis,

Thank you for writing.

You can save the current position of the horizontal scroll bar before you refresh the scheduler and after you call the Refresh method you can restore the position. Here is the code to achieve this:
private void buttonRefreshScheduler_Click(object sender, EventArgs e)
{
    RadScrollBarElement scrollBarElement = this.radSchedulerDemo.SchedulerElement.ViewElement.Children[3] as RadScrollBarElement;
 
    this.radSchedulerDemo.SchedulerElement.Refresh();
 
    this.radSchedulerDemo.SchedulerElement.NavigateToLastResource();
     
    int numberOfBackSteps = scrollBarElement.Maximum - scrollBarElement.Value - (this.radSchedulerDemo.SchedulerElement.View.ResourcesPerView - 1);
 
    for (int i = 0; i < numberOfBackSteps; i++)
    {
        this.radSchedulerDemo.SchedulerElement.NavigateToPreviousResource();
    }
}

A thing that needs clarification here. Why we go to the last resource and move backwards? The usual approach would be to start from the first and move forward. However, there is an issue in the NavigateToNextResource method and to workaround it we use this approach. I have logged the issue with the method in our Public Issue Tracking System - PITS. You can track its progress, subscribe for status change alerts and add your vote/comment to it on the following link - PITS Issue.

I have also updated your Telerik Points for bringing our attention to this issue,

I hope this will be useful. Should you have further questions, I would be glad to help.

Regards,
Ivan Petrov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
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 >>
Tags
Scheduler and Reminder
Asked by
Denis Cilliers
Top achievements
Rank 1
Answers by
Ivan Petrov
Telerik team
Share this question
or