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

Group by in timeline view

10 Answers 308 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Mattias
Top achievements
Rank 1
Mattias asked on 02 Sep 2008, 02:25 PM
Hi,
I don't understand how to group my appointments. :(
For example:
If I have one appointment that occurs 10 times (recurrence), I want these 10 to render on the same row, horizontaly.
And next appointment (if exists) it will render below, and so on.
How do I make the group by?

My first thought was to group by RecurrenceParentID but that doesn't seems to work.
RadScheduler1.DataSource = TaskBL.GetTasks(); 
            RadScheduler1.DataKeyField = "Id"
            RadScheduler1.DataSubjectField = "Name"
            RadScheduler1.DataStartField = "StartDate"
            RadScheduler1.DataEndField = "EndDate"
            RadScheduler1.DataRecurrenceField = "RecurrenceRule"
            RadScheduler1.DataRecurrenceParentKeyField = "RecurrenceParentId"
            RadScheduler1.GroupBy = "RecurrenceParentId"
            RadScheduler1.GroupingDirection = GroupingDirection.Vertical; 
With this code the timeline is just blank! No appointments showing!


10 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 02 Sep 2008, 03:09 PM
Hello Mattias,

The GroupBy property should be set to a resource type. Please, refer to the Resource Grouping example for a live demo of how the GroupBy property is used.


Best wishes,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Mattias
Top achievements
Rank 1
answered on 02 Sep 2008, 03:39 PM
Okay, but how do I set it code behind?
Is it not possible?

Maybe I can't use your scheduler control in my scenario!?
Your scheduler is very "outlook calendar" look a like with users and appointments. 
It would be nice in future releases if it can be more flat, not so program specific (or how I should explain it)!
A scheduler can be so much more than appointments! :)

I'm building a timeline that shows tasks (that can be recurrence).
I want the task subject on left side and the dates to the right, just as I explained in an earlier thread and your colleague Dimo said it may be possible:
http://www.telerik.com/community/forums/thread/b311D-bktkbg.aspx
I need the timeline to look almost like this:
http://www.svenskwebbhandel.se/timeline.gif

Do you think it is possible to build with your scheduler?


0
Peter
Telerik team
answered on 04 Sep 2008, 11:30 AM
Hi Mattias,

The GroupBy property can be set in code-behind. Please consider the following example of how this is done:

 <ResourceTypes> 
            <telerik:ResourceType DataSourceID="SqlDataSource2" ForeignKeyField="RoomID"   
                KeyField="ID" Name="Room" TextField="RoomName" /> 

protected void Page_Load(object sender, EventArgs e)  
    {          
            RadScheduler1.TimelineView.GroupBy = "Room";  
    } 

If you need to expose additional info for the appointments you need to use Templates. If you want to have different templates for the different views, please refer to the following kb article:
Creating and adding an appointment template dynamically and accessing the appointment object in the template class 

I hope you find these suggestions helpful.


Regards,
Peter
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
vairam
Top achievements
Rank 1
answered on 23 Jul 2009, 07:39 AM
Hi

my rad seheduler is dynamic control so how can i set the Resource type dynamatically

Regards
Vairamuthu
0
vairam
Top achievements
Rank 1
answered on 23 Jul 2009, 08:44 AM
i can create the resource type dynamatically.

Now my problem is i want the grouping only in the timeline view not in the monthly,day,weekly view.

My datatable like this

  LinkTitle                     EventDate                   EndDate                     FieldID

company meeting        01/15/2009 08 AM     01/15/2009 09 AM        1
company meeting        01/22/2009 08 AM     01/22/2009 09 AM        2
company meeting        02/22/2009 08 AM     02/22/2009 09 AM        3
Status meeting            01/22/2009  10 AM     01/22/2009 11 AM        4
Status meeting            01/26/2009  10 AM     01/26/2009 11 AM        5

in monthview i want all the meeting should display in the timelineview i want only two row(company meeting,Status meeting).
But i am getting five rows.
This is my code

_radScheduler.DataSource = dtFinalResult;
                _radScheduler.DataKeyField = "FieldID";
                _radScheduler.DataSubjectField = "LinkTitle";
                _radScheduler.DataStartField = "EventDate";
                _radScheduler.DataEndField = "EndDate";
                _radScheduler.DataBind();

                ResourceType resourcetype=new ResourceType();
                resourcetype.Name = "MPPScheduler";
                resourcetype.DataSource = dtFinalResult;
                resourcetype.KeyField = "FieldID";
                resourcetype.TextField = "LinkTitle";
                resourcetype.ForeignKeyField = "FieldID";
                radScheduler.Resourcetypes.Add(resourcetype);          
                _radScheduler.TimelineView.GroupBy = "MPPScheduler";
                _radScheduler.TimelineView.GroupingDirection = GroupingDirection.Vertical;
                _radScheduler.TimelineView.HeaderDateFormat = "MMM-dd";

What is the problem?

Regards
Vairam


0
Peter
Telerik team
answered on 28 Jul 2009, 11:44 AM
Hi vairam,

You should use DataSetHelper class with SelectDistinct method to create a separate datasource for your MPPScheduler resource type. I have attached a sample web site which shows how to create a new datatable with the "Priority" column and then add the "Priority" resource type dynamically to RadScheduler. You have to simply rename the appropriate fields with your own to make your application work as desired.


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
vairam
Top achievements
Rank 1
answered on 30 Jul 2009, 11:22 AM
Hi Peter

Thanks a lot its working for me .
Now My problem is in timelineview Text field is right align and its wrap to the next line.I need the left align with padding and increase the column width.
see this telerik demo link(Margaret Morrison Main Room,black auditorium) this text wrap to next to next line.How can i increase the width of the left hand side column.
http://demos.telerik.com/aspnet-ajax/scheduler/examples/timelineview/defaultcs.aspx

Regards
Vairamuthu
0
Peter
Telerik team
answered on 30 Jul 2009, 12:31 PM
Hi vairam,

To achieve this, please set RowHeaderWidth="300px" and apply the following css style:

.rsVerticalHeaderTable th   
{   
    text-align:left !important;   
}   
 



Regards,
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
vairam
Top achievements
Rank 1
answered on 30 Jul 2009, 01:13 PM
Hi

Is any way to change only for timelineview
RowHeaderWidth="300px"

Regards
Vairamuthu
0
Peter
Telerik team
answered on 30 Jul 2009, 01:57 PM
Hi vairam,

Yes, set the property in code-behind:
protected void Page_Load(object sender, EventArgs e)  
    {  
        if (!IsPostBack)  
        {  
            if (RadScheduler2.SelectedView == SchedulerViewType.TimelineView)  
                RadScheduler2.RowHeaderWidth = Unit.Pixel(300);  
            else 
                RadScheduler2.RowHeaderWidth = Unit.Pixel(100);  
        }          
    }  
     
    protected void RadScheduler2_NavigationComplete(object sender, SchedulerNavigationCompleteEventArgs e)  
    {  
        if (RadScheduler2.SelectedView == SchedulerViewType.TimelineView)  
            RadScheduler2.RowHeaderWidth = Unit.Pixel(300);  
        else 
            RadScheduler2.RowHeaderWidth = Unit.Pixel(100);  
    } 



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