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

[Solved] Dynamic Resource Filtering

3 Answers 151 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 07 May 2009, 12:31 PM
I would like to enable and disable showing resources much the same way you do in this demo:
http://demos.telerik.com/aspnet-ajax/scheduler/examples/resources/defaultcs.aspx

However, you staticly list the 3 resources in this demo and check against them.
For my purposes, I have made a checkboxlist that shows all the resources and has the resource's keyfield bound to it.
I can't seem to weave this into a usable filter using the code associated with this demo, any suggestions?

Chris

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 08 May 2009, 08:30 AM
Hello Chris,

In the Resources demo for Q3 2008, we used a dropdown list with select parameters for the appointment's data source:
 
<asp:DropDownList runat="server" ID="UserDropDown" AutoPostBack="true"   
                DataSourceID="UsersDataSource" DataTextField="UserName" DataValueField="ID" OnDataBound="UserDropDown_DataBound">  
            </asp:DropDownList> 
 
* * *  
 
 <sds:SessionDataSource ID="AppointmentsDataSource" runat="server"   
            PrimaryKeyFields="ID" 
           * * *> 
            <SelectParameters> 
                <asp:ControlParameter Name="UserID" ControlID="UserDropDown" PropertyName="SelectedValue" /> 
            </SelectParameters> 

Probably, you can use the same approach for your case as well. I have attached the pages of the Defining resources demo from Q3 2008 for reference. 

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.
0
Chris
Top achievements
Rank 1
answered on 10 May 2009, 02:36 PM
This is just a follow up for anyone requiring dynamic filtering, and by that I mean I don't know which resources are available for a specific calendar. What I ended up doing is simply filtering the datasource to the resourcetype based on the IDs tied to the checkboxlist of all the potential resources for the calendar. I thought I would have to set the appointments to visible= false like in the example I sighted initially, but If you simply remove a resource from the list of resources, it will not create a column for that resource. It still returns the appointments for that resource in the query for the appointments, but it's minimal if you're using optimized queries.

Chris
0
Peter
Telerik team
answered on 12 May 2009, 09:04 AM

Thank you for sharing your solution in the forum.


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.
Tags
Scheduler
Asked by
Chris
Top achievements
Rank 1
Answers by
Peter
Telerik team
Chris
Top achievements
Rank 1
Share this question
or