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

Timelineview and sorting

1 Answer 59 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Haderach
Top achievements
Rank 1
Haderach asked on 06 Dec 2010, 09:46 PM
Hello

I am using the RadScheduler and I am trying to make a custom sorting on resources names in Time Line View...
Do you have any idea to do so?

Secondly, always in TimeLineView, is there a way to make a sort on the beginning date of the appointements, in order to make a kind of Gantt Diagram ?


Thank you for help...

Read you soon.

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 09 Dec 2010, 11:46 AM
Hello Haderach,

You can sort resources by handling RadScheduler's DataBound event as follows:

protected void RadScheduler1_DataBound(object sender, EventArgs e)
   {
       
       List<Resource> userResources = new List<Resource>(RadScheduler1.Resources.GetResourcesByType("User"));
       foreach (Resource resource in userResources)
       {
           RadScheduler1.Resources.Remove(resource);          
       
       userResources.Sort(delegate(Resource a, Resource b)
       {
           return a.Text.CompareTo(b.Text);
       });
               
       foreach (Resource resource in userResources)
       {           
            RadScheduler1.Resources.Add(resource);
       }     
   }

To sort appointments by some custom criteria, you should use the AppointmentComparer property of RadScheduler as shown in this forum post
:http://www.telerik.com/community/forums/aspnet-ajax/scheduler/oder-of-entry-in-scheduler.aspx#1155620

For Web Service binding mode, please see this forum post:
 http://www.telerik.com/community/forums/aspnet-ajax/scheduler/example-of-how-to-use-an-appointmentcomparer.aspx#1188449

Feel free to contact us if you have further questions.

Best wishes,
Peter
the Telerik team
Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
Scheduler
Asked by
Haderach
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or