Group by in timeline view

11 posts, 0 answers
  1. Mattias
    Mattias avatar
    263 posts
    Member since:
    Aug 2012

    Posted 02 Sep 2008 Link to this post

    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!


  2. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 02 Sep 2008 Link to this post

    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.
  3. Mattias
    Mattias avatar
    263 posts
    Member since:
    Aug 2012

    Posted 02 Sep 2008 Link to this post

    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?


  4. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 04 Sep 2008 Link to this post

    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.
  5. vairam
    vairam avatar
    85 posts
    Member since:
    May 2008

    Posted 23 Jul 2009 Link to this post

    Hi

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

    Regards
    Vairamuthu
  6. vairam
    vairam avatar
    85 posts
    Member since:
    May 2008

    Posted 23 Jul 2009 Link to this post

    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


  7. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 28 Jul 2009 Link to this post

    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.
  8. vairam
    vairam avatar
    85 posts
    Member since:
    May 2008

    Posted 30 Jul 2009 Link to this post

    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
  9. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 30 Jul 2009 Link to this post

    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.
  10. vairam
    vairam avatar
    85 posts
    Member since:
    May 2008

    Posted 30 Jul 2009 Link to this post

    Hi

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

    Regards
    Vairamuthu
  11. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 30 Jul 2009 Link to this post

    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.
Back to Top