PlexityHide

Home 

Products 

Downloads 

Our Shop 

Support 

Contact 


GTP.NET.Silverlight and WPF FAQ 11431


Is there any way to show a background line between the days Please note that this article refers to GTP.NET.SL and WPF
Jump to article- 2009-04-09 11:14:00 - Email plexityHide

Question

 

Is there any way to show a background line between the days? Maybe even hours/minutes depending on scale?

 

Answer

You can do things like that by using the events, this code draws a line each day:

        void gantt1_OnDrawBackground(object sender, GanttUserDrawArgs e)

        {

            e.Canvas.Children.Clear();

            DateTime aDate=gantt10.DateScaler.StartTime;

            aDate=aDate.Date; // only keep date part

            while (aDate<gantt10.DateScaler.StopTime)

            {

                Line line = new Line();

                e.Canvas.Children.Add(line);

                line.X1 = gantt10.DateScaler.TimeToPixel(aDate);

                line.X2 = line.X1;

                line.Y1 = 0;

                line.Y2 = gantt10.ActualHeight;

                line.Stroke = new SolidColorBrush(Colors.Black);

                line.StrokeThickness = 1;

                aDate=aDate.AddDays(1);

            }

        }

 

Google
WWW plexityHide GTP.NET.SL FAQ
Support

Support intro

Knowledgebase

FAQ phGantTimePackage

FAQ GTP.NET

FAQ GTP.NET.SL and WPF

FAQ general

Testimonials

"This is too GREAT. I must say you have strong support and really good programmers at your place. Your entire team is good. Just Fantastic! – 100%"
Gaurav Patole,
WebTechDevelopers
More testimonials...




ody>