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

Timeline Footer

2 Answers 121 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Ben
Top achievements
Rank 1
Ben asked on 03 Feb 2012, 04:11 PM
Hello,

I was wondering if it was possible to have a footer at the bottom of the timeline view.  For example, it could show the number of appointments in that day or month.

2 Answers, 1 is accepted

Sort by
0
Ben
Top achievements
Rank 1
answered on 06 Feb 2012, 10:13 PM
I was able to get what I wanted accomplished here.  I have a month-view timeline with resource grouping.  There's a panel docked at the top and bottom, with the scheduler docked to fill the center.

The bottom panel is set to height 20.  In it, I have a RadLabel docked to the left side.  A RadGridView of height 40 is docked to the top in the center.  I had to set the grid height to at least 40 or else it would show scroll bars.  The DataSource of the RadGridView is a 1-row DataTable with 12 columns.

To handle the column sizing and scrolling (if SchedulerTimescale.DisplayedCellsCount < 12), I added this to the Form_Load():

TimelineGroupingByResourcesElement timeline = this.radScheduler1.SchedulerElement.ViewElement as TimelineGroupingByResourcesElement;
List<SchedulerTimelineViewElement> elements = timeline.GetTimelineElements();
elements[0].Header.Children[0].LayoutUpdated += new EventHandler(UpdateLayout);

Here's the UpdateLayout() method:

void UpdateLayout(object sender, EventArgs e)
        {
            TimelineGroupingByResourcesElement timeline = this.radScheduler1.SchedulerElement.ViewElement as TimelineGroupingByResourcesElement;
 
            //match label width to resource header width
            lblGridHeader.Width = timeline.ResourceHeaderWidth;
 
            List<SchedulerTimelineViewElement> elements = timeline.GetTimelineElements();
 
            //set main header title
            SchedulerHeaderCellElement headerElement = elements[0].Header.Children[0] as SchedulerHeaderCellElement;
            headerElement.Text = "Main Header Title";
 
            radGridView1.SuspendLayout();
 
            //hide every column
            for (int i = 0; i < radGridView1.Columns.Count; i++)
            {
                radGridView1.Columns[i].IsVisible = false;
            }
             
            for (int i = 1; i < elements[0].Header.Children.Count; i++)
            {
                headerElement = elements[0].Header.Children[i] as SchedulerHeaderCellElement;
 
                //shorten month column title to 3 letters
                headerElement.Text = headerElement.Text.Substring(0, 3);
 
                //unhide corresponding column and match column width
                radGridView1.Columns[headerElement.Date.Month - 1].IsVisible = true;
                radGridView1.Columns[headerElement.Date.Month - 1].Width = headerElement.Size.Width + 1;
            }
            radGridView1.ResumeLayout();
        }


Hopefully this will be useful to anyone else with this requirement.
0
Ivan Todorov
Telerik team
answered on 08 Feb 2012, 01:37 PM
Hi Ben,

I am glad to hear that you have solved your case. I am sure that the community will benefit from it. 

Greetings,
Ivan Todorov
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Scheduler and Reminder
Asked by
Ben
Top achievements
Rank 1
Answers by
Ben
Top achievements
Rank 1
Ivan Todorov
Telerik team
Share this question
or