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
0
Accepted
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
//code behind
//JavaScript
Regards,
Boyan Dimitrov
Telerik
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
>
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?
which function could Rebind the RadScheduler from javascript?
0
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
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.