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

radscheduler Q2sp1 labels not appearing on appointments in month and timeline view

2 Answers 111 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Kyri
Top achievements
Rank 2
Kyri asked on 12 Aug 2010, 02:59 AM
I am curently working on a winforms promotions module and i am using the scheduler control to display all the promotions that are occuring on certain dates for all our locations. The appointments are added to the control when the form that the control belongs to loads.

my code for creating the appointments is as follows

private void getAppointments()
       {
           radScheduler1.Appointments.Clear();
           try
           {
               DataTable getPromoDates = getPromoTab.Tables["PROMOTION_ADVICE_HEADERS"].Copy();
               DataTable getPromoColours = getPromoTab.Tables["PROMOTION_TYPES"].Copy();
               for (int i = 0; i < getPromoDates.Rows.Count; i++)
               {
                   Appointment myAppoint = new Appointment((DateTime)getPromoDates.Rows[i]["START_DATE"], (DateTime)getPromoDates.Rows[i]["END_DATE"]);
//the summary of the appointment is the promo tables primary key
                   myAppoint.Summary = getPromoDates.Rows[i]["PA_ID"].ToString();
                                      try
                   {
                       //lookup the promo type and set the background of the appointment (custom backgrounds are defined elsewhere)
                       int getColour = int.Parse(getPromoDates.Rows[i]["PROMO_TYPE"].ToString());
                       var getBackCol = from o in getPromoColours.AsEnumerable() where int.Parse(o.Field<decimal>("PT_ID").ToString()) == getColour select new { colourNum = o.Field<decimal>("COLOR_ID") };
                       myAppoint.BackgroundId = int.Parse(getBackCol.ElementAt(0).colourNum.ToString());
                   }
                   catch (FormatException ex)
                   {
                       myAppoint.BackgroundId = 99;
                   }
                   string isprocessed = "Finalised";
                   if (getPromoDates.Rows[i]["Processed"].ToString() == "N")
                   {
                       isprocessed = "Open";
                   }
                   myAppoint.Visible = true;
                     //set the location attribute of the appointment to some meaningful string describing aspects of the promotion
                    myAppoint.Location = getPromoDates.Rows[i]["DESCRIPTION"].ToString() + " - " + ((DateTime)getPromoDates.Rows[i]["START_DATE"]).ToShortDateString() + " - " + ((DateTime)getPromoDates.Rows[i]["END_DATE"]).ToShortDateString();
                   myAppoint.Location = myAppoint.Location + " " + isprocessed;
                   myAppoint.Description = myAppoint.Location;
                     
                   radScheduler1.Appointments.Add(myAppoint);
               }
               radScheduler1.AutoSize = true;
               radScheduler1.BackColor = Color.LemonChiffon;
                
               radScheduler1.Update();
               radToolStripLabelElement2.Text = radScheduler1.ActiveView.StartDate.ToLongDateString() + " - " + radScheduler1.ActiveView.EndDate.ToLongDateString();
           }
           catch (Exception ex)
           {
           }

radScheduler1.ActiveViewType = SchedulerViewType.Month;

 

 

 

// radScheduler1.ActiveViewType = SchedulerViewType.Week;

 

 

 

SchedulerMonthView myMonthView = new SchedulerMonthView(DateTime.Now, true);

 

myMonthView.EnableWeeksHeader =

 

false;

 

myMonthView.WeekCount = 1;

myMonthView.HeaderFormat =

 

"dd-MM-yyyy";

 

myMonthView.ShowHeader =

 

true;

 

myMonthView.ShowWeeksHeader =

 

false;

 

radScheduler1.ShowAppointmentStatus =

 

true;

 

 

 

 

//myAppoint.Location

 

 

 

//SchedulerWeekView myMonthView = new SchedulerWeekView();

 

 

radScheduler1.ActiveView = myMonthView;

 

radToolStripLabelElement1.Text =

 

" ".PadRight(400, ' ');

 

radToolStripLabelElement2.Text = radScheduler1.ActiveView.StartDate.ToLongDateString() +

 

" - " + radScheduler1.ActiveView.EndDate.ToLongDateString();

 

radScheduler1.Width =

 

this.Width - 10;

 

radScheduler1.Height =

 

this.Height - radToolStrip1.Height - 15 - radDateTimePicker1.Height;

 

radSplitContainer1.Width =

 

this.Width - 10;

 

radSplitContainer1.Height =

 

this.Height - radToolStrip1.Height - 15 - radDateTimePicker1.Height;

 

radGridView1.Width =

 

this.Width - 20;

 


       }
So when i run this program, the appointents are created correctly with the right background colours but the appointments have no labels. See attached screenshot. capture.png. The exact same code on 2010Q2 produced screenshot capture2.png.
Any ideas on how i can fix this? Also i could prefer to use the timeline view, the reason i used the month view was because in the Q1 release, i had the same issue as described above, but the monthview labeling worked but the timeline view didnt.

2 Answers, 1 is accepted

Sort by
0
Kyri
Top achievements
Rank 2
answered on 13 Aug 2010, 06:23 AM
found the solution, you must explicetely set the fonts and colors for each custom appointmentbackgroundInfo
AppointmentBackgroundInfo myABGI =  new AppointmentBackgroundInfo();
 myABGI.Id = k;
 myABGI.DisplayName =  s;
  
 myABGI.GradientStyle = Telerik.WinControls.GradientStyles.Glass;               
 myABGI.BackColor = getCol;                              
 myABGI.Font = new System.Drawing.Font("SEGOE UI", 8.0f, FontStyle.Bold);
 myABGI.ForeColor = Color.Black;
 myABGI.BorderColor = Color.Black;
 myABGI.BorderBoxStyle = Telerik.WinControls.BorderBoxStyle.OuterInnerBorders;
 myABGI.BorderGradientStyle = Telerik.WinControls.GradientStyles.Solid;
 myABGI.GradientAngle = 270f;
 myABGI.ShadowStyle = ShadowStyles.None;
 //myABGI.ShadowWidth = 1;
 this.radScheduler1.Backgrounds.Add(myABGI);
0
Peter
Telerik team
answered on 17 Aug 2010, 01:33 PM
Hi Kyri,

Thank you for writing.

The issue is caused by the Windows Regional Settings->Culture Decimal separator. In case the separator is a dot the problem does not occur. However, setting a symbol different than a dot will trigger the wrong behavior.

This is a known issue and we will address it in our next internal build scheduled for this Friday. Please accept our apologies for the caused inconvenience.

Do not hesitate to contact us if you have further questions.

Greetings,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Scheduler and Reminder
Asked by
Kyri
Top achievements
Rank 2
Answers by
Kyri
Top achievements
Rank 2
Peter
Telerik team
Share this question
or