How do you create cascading Dropdown for Resource Type. We have two resources added to appoint. Class and teacher. We want during time of creation of appointment. When user selects class. The teacher drop down should filter the data and show only teacher for that class. We are using Linqdatasource
question 1: For teacher Linqsource how can we pass parameter as class dropdown control value.
question 2: How can we define on selected index change event for dropdown class.
question 3: How can you make teacher dropdown invisible as default. and make it visible on selected index change event of Class dropdown.
13 Answers, 1 is accepted
The following kb article will help you get started:
http://www.telerik.com/support/kb/aspnet-ajax/scheduler/implement-related-dropdownlist-controls-in-the-advanced-form.aspx
All the best,
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Can you provide working selected index change event for given example.
Secondly in all the examples for User and room the data source is XML file. Do we have any User and Room example which uses Linq as datasource.
I am not sure why you experience this problem at your end. If you can send us a workig project demonstrating the issue, we will be able to tell what the problem is. To be able to attach files, you need to open a support ticket.
As for the other question, here is a LINQ data source online demo with RadScheduler:
http://demos.telerik.com/aspnet-ajax/scheduler/examples/linqdatasource/defaultcs.aspx
Also, there is a kb article with LINQ:
http://www.telerik.com/support/kb/aspnet-ajax/scheduler/radscheduler-with-linqdatasource.aspx
Greetings,
Peter
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
The link you posted (http://www.telerik.com/support/kb/aspnet-ajax/scheduler/implement-related-dropdownlist-controls-in-the-advanced-form.aspx) is dead.
Do you have and example that could help me to apply styles dynamically to a Scheduler event? I wrote the following code but the scheduler just ignores it and the style isn't applied:
@Page_PreRender:
... Scheduler1.DataSource = userEvents; Scheduler1.DataBind(); foreach (var eventTypes in events.sp_Select_EventTypesByOrgID(orgId)) |
{ |
string color = eventTypes.Color; |
string absencetype = eventTypes.AbsenceType; |
RadScheduler1.Resources.Add(new Resource("EventType", eventTypes.EventTypeID, eventTypes.EventType.Trim())); |
RadScheduler1.ResourceStyles.Add(new ResourceStyleMapping("Calendar", eventtype, "rsCategory" + color.Trim())); |
} |
I have a column named Color and it is being correctely populated so it is matching Telerik's (16) styles. I even tried applying styles during the Databound but it didn't work as well:
@RadScheduler1_AppointmentDataBound:
if (e.Appointment.Resources.GetResourceByType("Calendar") != null ) |
{ |
string eventType = e.Appointment.Resources[0].Text.Trim(); |
if (eventType != null) |
{ |
switch (eventType) |
{ |
case "Meeting": |
e.Appointment.CssClass = "rsCategoryOrange"; |
break; |
/// more here |
default: |
e.Appointment.CssClass = "rsCategoryBlue"; |
break; |
} |
} |
It works thou if I hardcode the styles to the HTML but it crashes if my Org passes an event not coded there.
Maybe I'm applying the styles at a wrong place... any clue?
Thanks!
Gilberto
The kb article you refer to has been updated and its url has changed (aplogies for this). Here is the correct url in case you need it for reference:
http://www.telerik.com/support/kb/aspnet-ajax/scheduler/implement-related-radcombobox-controls-in-the-advanced-form.aspx
As for the other issue, I am not sure why you need to handle Page_PreRender, but this event might be too late for the styles to be applied and to declare resources. Can you move your logic in Page_Init or Page_Load instead.
Alternatively, you can declare resource style mapping inline as in this demo:
http://demos.telerik.com/aspnet-ajax/scheduler/examples/resourceavailability/defaultcs.aspx
<
ResourceStyles
>
<
telerik:ResourceStyleMapping
Type
=
"User"
Text
=
"Alex"
ApplyCssClass
=
"rsCategoryBlue"
/>
<
telerik:ResourceStyleMapping
Type
=
"User"
Text
=
"Bob"
ApplyCssClass
=
"rsCategoryOrange"
/>
<
telerik:ResourceStyleMapping
Type
=
"User"
Text
=
"Charlie"
ApplyCssClass
=
"rsCategoryGreen"
/>
</
ResourceStyles
>
All the best,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
What is the exact problem that you experience?
Do you want to apply styles dynamically to RadScheduler or something different?
Kind regards,
Helen
the Telerik team
This is what I did and can't cascade.
ResourceTypes
telerik:ResourceType DataSourceID="SqlDataSource2" ForeignKeyField="Programs"
KeyField="Description" Name="ProgramType" TextField="Description"
telerik:ResourceType DataSourceID="SqlDataSource1" ForeignKeyField="Users"
KeyField="Full_Name" Name="All_Users" TextField="Full_Name"
telerik:ResourceType DataSourceID="SqlDataSource3" ForeignKeyField="ROOMS"
KeyField="ROOMNAME" Name="NameOfRoom" TextField="ROOMNAME"
ResourceTypes
Have you tried the approach used in this kb article -
http://www.telerik.com/support/kb/aspnet-ajax/scheduler/implement-related-radcombobox-controls-in-the-advanced-form.aspx?
Note that you need to use custom attributes instead of resources to achieve the related comboboxes functionality.
Greetings, Peter
the Telerik team
There is a tutorial in the help -
http://www.telerik.com/help/aspnet-ajax/scheduler-customzing-advanced-form-advanced-templates.html
Regards,
Peter
the Telerik team