Spread Silverlight Documentation
DateOccurringType Enumeration
Example Example 


Specifies a condition for when a date occurs.
Syntax
'Declaration
 
Public Enum DateOccurringType 
   Inherits System.Enum
'Usage
 
Dim instance As DateOccurringType
public enum DateOccurringType : System.Enum 
Members
MemberDescription
Last7DaysSpecifies the last seven days.
LastMonthSpecifies last month.
LastWeekSpecifies last week.
NextMonthSpecifies next month.
NextWeekSpecifies next week.
ThisMonthSpecifies this month.
ThisWeekSpecifies this week.
TodaySpecifies today.
TomorrowSpecifies tomorrow.
YesterdaySpecifies yesterday.
Example
This example uses the DateOccurringType enumeration.
var style = new GrapeCity.Windows.SpreadSheet.Data.StyleInfo();
style.Background = new SolidColorBrush(Colors.Blue);
style.BorderLeft = new GrapeCity.Windows.SpreadSheet.Data.BorderLine(Colors.Red);
style.BorderTop = new GrapeCity.Windows.SpreadSheet.Data.BorderLine(Colors.Red);
style.BorderRight = new GrapeCity.Windows.SpreadSheet.Data.BorderLine(Colors.Red);
style.BorderBottom = new GrapeCity.Windows.SpreadSheet.Data.BorderLine(Colors.Red);
var style1 = new GrapeCity.Windows.SpreadSheet.Data.StyleInfo();
style1.Background = new SolidColorBrush(Colors.Green);
var style2 = new GrapeCity.Windows.SpreadSheet.Data.StyleInfo();
style2.Background = new SolidColorBrush(Colors.Yellow);

var rule = GrapeCity.Windows.SpreadSheet.Data.DateOccurringRule.Create(GrapeCity.Windows.SpreadSheet.Data.DateOccurringType.NextWeek, style);           
rule.Ranges = new GrapeCity.Windows.SpreadSheet.Data.CellRange[] { new GrapeCity.Windows.SpreadSheet.Data.CellRange(0, 0, 10, 1) };
gcSpreadSheet1.Sheets[0].ConditionalFormats.AddRule(rule);

gcSpreadSheet1.Sheets[0].SetValue(0, 0, GrapeCity.Windows.SpreadSheet.Data.SheetArea.Cells, DateTime.Now);
gcSpreadSheet1.Sheets[0].SetValue(1, 0, GrapeCity.Windows.SpreadSheet.Data.SheetArea.Cells, DateTime.Now.AddDays(1));
gcSpreadSheet1.Sheets[0].SetValue(2, 0, GrapeCity.Windows.SpreadSheet.Data.SheetArea.Cells, DateTime.Now.AddDays(5));
gcSpreadSheet1.Sheets[0].SetValue(3, 0, GrapeCity.Windows.SpreadSheet.Data.SheetArea.Cells, DateTime.Now.AddDays(6));
gcSpreadSheet1.Sheets[0].SetValue(4, 0, GrapeCity.Windows.SpreadSheet.Data.SheetArea.Cells, DateTime.Now.AddDays(7));
gcSpreadSheet1.Sheets[0].SetValue(5, 0, GrapeCity.Windows.SpreadSheet.Data.SheetArea.Cells, DateTime.Now.AddDays(8));
gcSpreadSheet1.Invalidate();
Dim style As New GrapeCity.Windows.SpreadSheet.Data.StyleInfo()
style.Background = New SolidColorBrush(Colors.Blue)
style.BorderLeft = New GrapeCity.Windows.SpreadSheet.Data.BorderLine(Colors.Red)
style.BorderTop = New GrapeCity.Windows.SpreadSheet.Data.BorderLine(Colors.Red)
style.BorderRight = New GrapeCity.Windows.SpreadSheet.Data.BorderLine(Colors.Red)
style.BorderBottom = New GrapeCity.Windows.SpreadSheet.Data.BorderLine(Colors.Red)
Dim style1 As New GrapeCity.Windows.SpreadSheet.Data.StyleInfo()
style1.Background = New SolidColorBrush(Colors.Green)
Dim style2 As New GrapeCity.Windows.SpreadSheet.Data.StyleInfo()
style2.Background = New SolidColorBrush(Colors.Yellow)

Dim rule = GrapeCity.Windows.SpreadSheet.Data.DateOccurringRule.Create(GrapeCity.Windows.SpreadSheet.Data.DateOccurringType.NextWeek, style)
rule.Ranges = New GrapeCity.Windows.SpreadSheet.Data.CellRange() {New GrapeCity.Windows.SpreadSheet.Data.CellRange(0, 0, 10, 1)}
GcSpreadSheet1.Sheets(0).ConditionalFormats.AddRule(rule)
GcSpreadSheet1.Sheets(0).SetValue(0, 0, GrapeCity.Windows.SpreadSheet.Data.SheetArea.Cells, DateTime.Now)
GcSpreadSheet1.Sheets(0).SetValue(1, 0, GrapeCity.Windows.SpreadSheet.Data.SheetArea.Cells, DateTime.Now.AddDays(1))
GcSpreadSheet1.Sheets(0).SetValue(2, 0, GrapeCity.Windows.SpreadSheet.Data.SheetArea.Cells, DateTime.Now.AddDays(5))
GcSpreadSheet1.Sheets(0).SetValue(3, 0, GrapeCity.Windows.SpreadSheet.Data.SheetArea.Cells, DateTime.Now.AddDays(6))
GcSpreadSheet1.Sheets(0).SetValue(4, 0, GrapeCity.Windows.SpreadSheet.Data.SheetArea.Cells, DateTime.Now.AddDays(7))
GcSpreadSheet1.Sheets(0).SetValue(5, 0, GrapeCity.Windows.SpreadSheet.Data.SheetArea.Cells, DateTime.Now.AddDays(8))
GcSpreadSheet1.Invalidate()
Inheritance Hierarchy

System.Object
   System.ValueType
      System.Enum
         GrapeCity.Windows.SpreadSheet.Data.DateOccurringType

Requirements

Target Platforms: Windows 7, Windows 8 Desktop, Windows Vista SP1 or later, Windows Server 2000, Windows 2000 Professional, Windows XP Professional, Windows NT 4.0 Workstation, SP6, Windows NT 4.0 Server, SP6

See Also

Reference

GrapeCity.Windows.SpreadSheet.Data Namespace

 

 


Copyright © GrapeCity, inc. All rights reserved.