Spread for ASP.NET 7.0 Product Documentation
TimePeriod Enumeration
Example  See Also  Support Options
FarPoint.Web.Spread Assembly > FarPoint.Web.Spread Namespace : TimePeriod Enumeration


Glossary Item Box

Represents a time period which is used in a date conditional formatting rule. These are dynamic time periods, which change based on the date the conditional formatting rule is refreshed or applied.

Syntax

Visual Basic (Declaration) 
Public Enum TimePeriod 
   Inherits System.Enum
Visual Basic (Usage)Copy Code
Dim instance As TimePeriod
C# 
public enum TimePeriod : System.Enum 

Members

MemberDescription
Last7DaysIndicates a date in the last seven days.
LastMonthIndicates a date that occurred in the last calendar month.
LastWeekIndicates a date that occurred last week.
NextMonthIndicates a date that occurs in the next calendar month.
NextWeekIndicates a date that occurs next week.
ThisMonthIndicates a date that occurs in this calendar month.
ThisWeekIndicates a date that occurs this week.
TodayIndicates today's date.
TomorrowIndicates tomorrow's date.
YesterdayIndicates yesterday's date.

Example

This example sets the TimePeriod enumeration.
C#Copy Code
protected void Page_Load(object sender, System.EventArgs e)
                       {
                           FpSpread1.Sheets[0].Cells[1, 1].Value = DateTime.Now;
                       }

protected void Button1_Click(object sender, EventArgs e)
        {
            //Date Occurs CF
            FarPoint.Web.Spread.TimePeriodConditionalFormattingRule time = new FarPoint.Web.Spread.TimePeriodConditionalFormattingRule(FarPoint.Web.Spread.TimePeriod.Last7Days);
            time.TimePeriod = FarPoint.Web.Spread.TimePeriod.Last7Days;
            time.ForeColor = Color.Magenta;
            FpSpread1.ActiveSheetView.SetConditionalFormatting(1, 1, time);
        }
VB.NETCopy Code
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            FpSpread1.Sheets(0).Cells(1, 1).Value = Date.Now
        End Sub

Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            'Date Occurs CF
            Dim time As New FarPoint.Web.Spread.TimePeriodConditionalFormattingRule(FarPoint.Web.Spread.TimePeriod.Last7Days)
            time.TimePeriod = FarPoint.Web.Spread.TimePeriod.Last7Days
            time.ForeColor = Drawing.Color.DarkMagenta
            FpSpread1.ActiveSheetView.SetConditionalFormatting(1, 1, time)
        End Sub

Inheritance Hierarchy

System.Object
   System.ValueType
      System.Enum
         FarPoint.Web.Spread.TimePeriod

Requirements

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

See Also

© 2002-2014 ComponentOne, a division of GrapeCity. All Rights Reserved.