2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
Customize the label, marker and reminder color of appointmentsBy default, the color will be set to appointment based on IScheduleAppointment.LabelValue. In order to change the custom color for the appointment label, DrawCellDisplayText event can be used. C# //Event Subscription this.scheduleControl1.GetScheduleHost().DrawCellDisplayText += Form1_DrawCellDisplayText; //Event Customization void Form1_DrawCellDisplayText(object sender, Syncfusion.Windows.Forms.Grid.GridDrawCellDisplayTextEventArgs e) { if (e.Style.CellValue.ToString().Contains("subject")) { Color c = ((ListObject)scheduleProvider.GetLocations()[2]).ColorMember; Rectangle rect = e.TextRectangle; rect.Y += 16; rect.Height -= 16; e.Graphics.FillRectangle(new SolidBrush(c), rect.X, rect.Y + 10, rect.Width - 2, 20); e.Graphics.DrawString("Subject Mon:Tue", e.Style.GdipFont, new SolidBrush(e.Style.TextColor), new Point(rect.X + 2, rect.Y + 12)); } } VB 'Event Subscription AddHandler Me.scheduleControl1.GetScheduleHost().DrawCellDisplayText, AddressOf Form1_DrawCellDisplayText 'Event Customization Private Sub Form1_DrawCellDisplayText(ByVal sender As Object, ByVal e As Syncfusion.Windows.Forms.Grid.GridDrawCellDisplayTextEventArgs) If e.Style.CellValue.ToString().Contains("subject") Then Dim c As Color = (CType(scheduleProvider.GetLocations()(2), ListObject)).ColorMember Dim rect As Rectangle = e.TextRectangle rect.Y += 16 rect.Height -= 16 e.Graphics.FillRectangle(New SolidBrush(c), rect.X, rect.Y + 10, rect.Width - 2, 20) e.Graphics.DrawString("Subject Mon:Tue", e.Style.GdipFont, New SolidBrush(e.Style.TextColor), New Point(rect.X + 2, rect.Y + 12)) End If End Sub Screenshot Note: The Grid.Windows.dll should be added to the assembly reference to access the DrawCellDisplayText event. Samples: |
2X faster development
The ultimate WinForms UI toolkit to boost your development speed.
This page will automatically be redirected to the sign-in page in 10 seconds.