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

Dynamically Scroll

4 Answers 53 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Ala eddine
Top achievements
Rank 1
Ala eddine asked on 05 Jul 2013, 04:03 PM

Hello,

In timelineView i want to set first resource in the header column by dynamic scroll.
In fact I have a ComboBox to chose a Value, I the radscheduler must scroll dynamically until the
line having a Text ==  Value take the first place.

the attached file shows what I want to have


Thank your for helping me.

4 Answers, 1 is accepted

Sort by
0
Accepted
Boyan Dimitrov
Telerik team
answered on 10 Jul 2013, 08:07 AM
Hello,

An easy and convenient way of achieving such functionality would be use the RadScheduler TimeSlotCreated server-side event handler as shown in the snippet below:
//markup code
<telerik:RadComboBox ID="RadComboBox1" runat="server" AutoPostBack="true" OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged">
    <Items>
        <telerik:RadComboBoxItem  Text="George"/>
        <telerik:RadComboBoxItem  Text="Kate"/>
    </Items>
</telerik:RadComboBox>
<div>
    <telerik:RadScheduler runat="server" ID="RadScheduler1" GroupBy="User" GroupingDirection="Vertical" OnTimeSlotCreated="RadScheduler1_TimeSlotCreated">
    </telerik:RadScheduler>
</div>
//code behind
protected void Page_Load(object sender, EventArgs e)
    {
        Session["User"] = "George";
    }
 
    //please note that I assume you have already bound your RadScheduler control. The user resource names are for sample purposes.
 
    protected void RadScheduler1_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
    {
        if (e.TimeSlot.Resource.Text == Session["User"].ToString())
        {
            e.TimeSlot.CssClass = "TimeSlotCssForUser";
        }
    }
    protected void RadComboBox1_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        Session["User"] = e.Text;
        RadScheduler1.Rebind();
    }

//JavaScript
function pageLoad() {
    var scheduler = $find('<%= RadScheduler1.ClientID %>');
    var scrolledIntoViewSlot = $telerik.getElementByClassName(scheduler.get_element(), "TimeSlotCssForUser", "td");
    if (scrolledIntoViewSlot)
        setTimeout(function () { scrolledIntoViewSlot.scrollIntoView(); }, 200);
}

Regards,
Boyan Dimitrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Ala eddine
Top achievements
Rank 1
answered on 10 Jul 2013, 09:10 AM
Thank you , that helps me so much :) !
0
Ala eddine
Top achievements
Rank 1
answered on 10 Jul 2013, 09:13 AM
Hello,

which function could Rebind the RadScheduler from javascript?
 
0
Boyan Dimitrov
Telerik team
answered on 11 Jul 2013, 03:12 PM
Hello,

I would like to clarify that the method rebind() of the RadScheduler client-side object will apply only if the RadScheduler control is populated via web service binding. If you use server-side binding I would suggest using the RadAjaxManager to perform an Ajax request to the server and execute the Rebind() method of the RadScheduler control.

Regards,
Boyan Dimitrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Scheduler
Asked by
Ala eddine
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Ala eddine
Top achievements
Rank 1
Share this question
or