MindFusion WinForms Programmer's Guide
DateStyle.Priority Property
See Also
 





Gets or sets the format priority. If one date has several styles applied to it, only the highest in priority is taken into account.

Namespace: MindFusion.Scheduling.WinForms
Assembly: MindFusion.Scheduling

 Syntax

C#  Copy Code

public int Priority { get; set; }

Visual Basic  Copy Code

Public Property Priority As Integer

 Property Value

An integer value specifying the priority of this style.

 Remarks

When a time cell is included in the time intervals of several DateStyle or DayOfWeekStyle objects, the style that has the highest priority is used.

 Example

 Note

If you want the overlapping styles for a single date to cascade, you have to specify different priorities for them.

The following example illustrates how to create overlapping DateStyle objects for a specific date in a SingleMonth view. The example creates two date styles - one for the time range 03/15 - 03/20 and another for the time range 03/18 - 03/24. The two styles have different priorities to allow cascading. If both styles have had the same priorities, only the second style would have been used for the dates in the overlapped range (03/18 - 03/20).

C#  Copy Code

DateStyle style1 = new DateStyle();
style1.From = new DateTime(2006, 3, 15);
style1.To = new DateTime(2006, 3, 20);
style1.Style = new Style();
style1.Style.BorderLeftWidth = 2;
style1.Style.BorderTopWidth = 2;
style1.Style.BorderRightWidth = 2;
style1.Style.BorderBottomWidth = 2;
style1.Priority = 1;
calendar.DayStyles.Add(style1);

DateStyle style2 = new DateStyle();
style2.From = new DateTime(2006, 3, 18);
style2.To = new DateTime(2006, 3, 24);
style2.Style = new Style();
style2.Style.Brush = new MindFusion.Drawing.SolidBrush(Color.PaleGoldenrod);
style2.Priority = 2;
calendar.DayStyles.Add(style2);

Visual Basic  Copy Code

Dim style1 As New DateStyle()
style1.From = New DateTime(2006, 3, 15)
style1.To = New DateTime(2006, 3, 20)
style1.Style = New Style()
style1.Style.BorderLeftWidth = 2
style1.Style.BorderTopWidth = 2
style1.Style.BorderRightWidth = 2
style1.Style.BorderBottomWidth = 2
style1.Priority = 1
calendar.DayStyles.Add(style1)

Dim style2 As New DateStyle()
style2.From = New DateTime(2006, 3, 18)
style2.To = New DateTime(2006, 3, 24)
style2.Style = New Style()
style2.Style.Brush = New MindFusion.Drawing.SolidBrush(Color.PaleGoldenrod)
style2.Priority = 2
calendar.DayStyles.Add(style2)

 See Also

DateStyle Members
DateStyle Class
MindFusion.Scheduling.WinForms Namespace