Spread for ASP.NET 10 Product Documentation
TimePeriod Property
Example 


Gets or sets the time period.
Syntax
'Declaration
 
Public Property TimePeriod As TimePeriod
'Usage
 
Dim instance As TimePeriodConditionalFormattingRule
Dim value As TimePeriod
 
instance.TimePeriod = value
 
value = instance.TimePeriod
public TimePeriod TimePeriod {get; set;}

Property Value

The time period.
Example
This example sets the TimePeriod property.
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);
        }
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
Requirements

Target Platforms: Windows 7, Windows 8, Windows 10, Windows Vista, Windows Server 2003, Windows Server 2008, Windows Server 2012, Windows XP Professional

See Also

Reference

TimePeriodConditionalFormattingRule Class
TimePeriodConditionalFormattingRule Members

 

 


Copyright © GrapeCity, inc. All rights reserved.