We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Looking for more details

Thread ID:

Created:

Updated:

Platform:

Replies:

141774 Jan 3,2019 05:03 PM UTC Jan 4,2019 08:46 AM UTC WinForms 1
loading
Tags: ScheduleControl
Craig Brown
Asked On January 3, 2019 05:03 PM UTC

Hi,

I am using the Schedule Control in one of my apps. It is great!   I would like to have icons appear on the monthly view to indicate certain events rather than shortened text describing the event. Is that possible?  Also, let's say I have some kind of event that I want to show up as a particular color on the calendar. How can I do that?  Is there a document that describes the full api! ?

I would also like to thank Syncfusion for their great attitude toward startup companies.  I left my position as Head of Information Security at Kaspersky labs to create the most advanced hacker defense tools available.  I have been coding alone for five years and am now demonstrating the product. I only have a few Syncfusion controls built in right now, but they are critical.  The app is not "slick" and I plan to replace all standard controls with Syncfusion controls.  The system has components in Xamarin, Winforms and several other places. I could not afford the full price licensing.  But it is an Enterprise app and when I have revenue, I'm more than happy to pay all full licensing fees.  Your liberal policy has made me a Syncfusion customer for life!  Plus, by not accepting investment capital, I can offer the product for free to small companies and non-profits. It can change the world in the way Information Security is done.

So, thanks for that!

BTW: If you CISO wants to run a pilot, I would be happy to do it!

Best Regards,

Craig

Arulraj A [Syncfusion]
Replied On January 4, 2019 08:46 AM UTC

Hi Craig, 
 
Thanks for using Syncfusion product. 
 
Query 
Response 
 I would like to have icons appear on the monthly view to indicate certain events rather than shortened text describing the event. Is that possible? 
By default, ScheduleControl does not have the direct support to load the image for specific events. But, You could achieve your reported scenario by handling the DrawCellDisplayText event. Please refer the following code example and the sample. 
 
C# 
this.scheduleControl1.GetScheduleHost().DrawCellDisplayText += Form1_DrawCellDisplayText; 
void Form1_DrawCellDisplayText(object sender, Syncfusion.Windows.Forms.Grid.GridDrawCellDisplayTextEventArgs e) 
{ 
    if (e.Style.CellValue.ToString().Contains("subject")) 
    {                  
        string date = e.Style.CellValue.ToString().Substring(0, e.Style.CellValue.ToString().IndexOf("\n")); 
        DateTime dateTime; 
        if (e.RowIndex == 1 && e.ColIndex == 1) 
        { 
            dateTime = DateTime.ParseExact(date, this.scheduleControl1.Appearance.WeekMonthNewMonth, this.scheduleControl1.Culture).Date; 
        } 
        else 
        { 
            dateTime = DateTime.Parse(date, this.scheduleControl1.Culture).Date; 
        } 
        IScheduleAppointmentList list = this.scheduleControl1.DataSource.GetSchedule(dateTime, dateTime); 
        Color c = ((ListObject)scheduleProvider.GetLabels()[4]).ColorMember; 
        Rectangle rect = e.TextRectangle; 
        Rectangle eventRect = new Rectangle(rect.X + 6, rect.Y + 22, e.ClipBounds.Width, 27); 
        foreach (IScheduleAppointment item in list) 
        { 
            c = ((ListObject)scheduleProvider.GetLabels()[item.LabelValue]).ColorMember; 
            if (dateTime.Date == DateTime.Now.Date) 
            { 
                Bitmap bmp = SystemIcons.Application.ToBitmap(); 
                Size size = new Size(bmp.Width, eventRect.Height); 
                Bitmap img = new Bitmap(bmp, size); 
                e.Graphics.FillRectangle(new SolidBrush(c), eventRect); 
                e.Graphics.DrawImage(img, eventRect.Location); 
            } 
            else 
            { 
                e.Graphics.FillRectangle(new SolidBrush(c), eventRect); 
                e.Graphics.DrawString(item.Subject, e.Style.GdipFont, new SolidBrush(e.Style.TextColor), new Point(eventRect.X + 2, eventRect.Y + 12)); 
            } 
            eventRect.Y += eventRect.Height + 7; 
        } 
    } 
}  
 
Please refer the following KB link, 
Also, let's say I have some kind of event that I want to show up as a particular color on the calendar. How can I do that?  Is there a document that describes the full api! ? 
To customize the events color, you could implement the custom ScheduleDataProvider and override the InitLists and Getlabels method . Please refer the following kb link, 
 
 

Regards, 
Arulraj A 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;