Spread Windows Forms 11.0 Product Documentation
DateTimeGroupingType Enumeration
Example Example 


FarPoint.Win.Spread Assembly > FarPoint.Win.Spread Namespace : DateTimeGroupingType Enumeration
Specifies the part of the date time value used in a comparision.
Syntax
'Declaration
 
Public Enum DateTimeGroupingType 
   Inherits System.Enum
'Usage
 
Dim instance As DateTimeGroupingType
public enum DateTimeGroupingType : System.Enum 
Members
MemberDescription
AllSpecifies datetime values compared by all values
DateSpecifies datetime values compared by date (time is ignored)
DaySpecifies datetime values compared by day
HourSpecifies datetime values compared by hour
MinuteSpecifies datetime values compared by minute
MonthSpecifies datetime values compared by month
SecondSpecifies datetime values compared by second
YearSpecifies datetime values compared by year
Example
This example uses the DateTimeGroupingType enumeration.
FarPoint.Win.Spread.TableStyle tstyle = fpSpread1.CreateTableStyle("Style1", FarPoint.Win.Spread.TableStyle.TableStyleLight2);
fpSpread1.Sheets[0].Cells[1, 1].Text = "Last Name";
fpSpread1.Sheets[0].Cells[1, 2].Text = "Value";
fpSpread1.Sheets[0].Cells[2, 1].Text = "2/17/2016";
fpSpread1.Sheets[0].Cells[2, 2].Value = "Press";
fpSpread1.Sheets[0].Cells[3, 1].Text = "12/31/1990";
fpSpread1.Sheets[0].Cells[3, 2].Value = "Press";
fpSpread1.Sheets[0].Cells[4, 1].Text = "2017";
fpSpread1.Sheets[0].Cells[4, 2].Value = "test";
fpSpread1.TableStyleCollection.Add(tstyle);
FarPoint.Win.Spread.TableView table = fpSpread1.Sheets[0].AddTable("table", 1, 1, 5, 2, "Style1");

FarPoint.Win.Spread.FilterItemValue test = new FarPoint.Win.Spread.FilterItemValue(System.DateTime.Today, FarPoint.Win.Spread.DateTimeGroupingType.Year);
FarPoint.Win.Spread.FilterItemValue test1 = new FarPoint.Win.Spread.FilterItemValue(new System.DateTime(1990, 12, 31), FarPoint.Win.Spread.DateTimeGroupingType.Year);
FarPoint.Win.Spread.MultiValuesFilterItem multifilter = new FarPoint.Win.Spread.MultiValuesFilterItem(new FarPoint.Win.Spread.FilterItemValue[] { test, test1 });
//Use the customized filter by implementing IFilterItem and setting the filterItem to the table column.
table.Filter(0, multifilter);
Dim tstyle As FarPoint.Win.Spread.TableStyle = fpSpread1.CreateTableStyle("Style1", FarPoint.Win.Spread.TableStyle.TableStyleLight2)
fpSpread1.Sheets(0).Cells(1, 1).Text = "Last Name"
fpSpread1.Sheets(0).Cells(1, 2).Text = "Value"
fpSpread1.Sheets(0).Cells(2, 1).Text = "2/17/2016"
fpSpread1.Sheets(0).Cells(2, 2).Value = "Press"
fpSpread1.Sheets(0).Cells(3, 1).Text = "12/31/1990"
fpSpread1.Sheets(0).Cells(3, 2).Value = "Press"
fpSpread1.Sheets(0).Cells(4, 1).Text = "2017"
fpSpread1.Sheets(0).Cells(4, 2).Value = "test"
fpSpread1.TableStyleCollection.Add(tstyle)
Dim table As FarPoint.Win.Spread.TableView = fpSpread1.Sheets(0).AddTable("table", 1, 1, 5, 2, "Style1")

Dim test As New FarPoint.Win.Spread.FilterItemValue(System.DateTime.Today, FarPoint.Win.Spread.DateTimeGroupingType.Year)
Dim test1 As New FarPoint.Win.Spread.FilterItemValue(New System.DateTime(1990, 12, 31), FarPoint.Win.Spread.DateTimeGroupingType.Year)
Dim multifilter As New FarPoint.Win.Spread.MultiValuesFilterItem(New FarPoint.Win.Spread.FilterItemValue() {test, test1})
'Use the customized filter by implementing IFilterItem And setting the filterItem to the table column.
table.Filter(0, multifilter)
Inheritance Hierarchy

System.Object
   System.ValueType
      System.Enum
         FarPoint.Win.Spread.DateTimeGroupingType

See Also

Reference

FarPoint.Win.Spread Namespace