Spread Windows Forms 10.0 Product Documentation
FilterBarFilterDateTime Field
Example 


Specifies the index, 18, for the image for the filterbar calendar indicator.
Syntax
'Declaration
 
Public Const FilterBarFilterDateTime As Integer
'Usage
 
Dim value As Integer
 
value = SpreadView.FilterBarFilterDateTime
public const int FilterBarFilterDateTime
Example
This example creates a date time image for the filter bar.
System.Globalization.DateTimeFormatInfo dtf = new System.Globalization.DateTimeFormatInfo();
dtf.ShortDatePattern = "M/d/yyyy";
dtf.ShortTimePattern = "";
dtf.LongTimePattern = "";    

FarPoint.Win.Spread.CellType.FilterBarCellType fbcell = new FarPoint.Win.Spread.CellType.FilterBarCellType();
fbcell.AutoFormat = true;
fbcell.ContextMenuType = FarPoint.Win.Spread.CellType.FilterBarContextMenuType.DateTime;
fbcell.DateTimeFormatInfo = dtf;
fpSpread1.Sheets[0].AutoFilterMode = FarPoint.Win.Spread.AutoFilterMode.FilterBar;
fpSpread1.Sheets[0].FilterBar.Cells[0].CellType = fbcell;
fpSpread1.Sheets[0].Cells[0, 0].Value = "10/10/2014";
fpSpread1.Sheets[0].Columns[0].CellType = new FarPoint.Win.Spread.CellType.DateTimeCellType();
\\Select a date filter (such as before or after) to see the icon
FarPoint.Win.Spread.SpreadView wrkbk = fpSpread1.GetRootWorkbook();
wrkbk.SetImage(FarPoint.Win.Spread.SpreadView.FilterBarFilterDateTime, Image.FromFile("C:\\cut.png"));
Dim dtf As New System.Globalization.DateTimeFormatInfo()
dtf.ShortDatePattern = "M/d/yyyy"
dtf.ShortTimePattern = ""
dtf.LongTimePattern = ""

Dim fbcell As New FarPoint.Win.Spread.CellType.FilterBarCellType()
fbcell.AutoFormat = True
fbcell.ContextMenuType = FarPoint.Win.Spread.CellType.FilterBarContextMenuType.DateTime
fbcell.DateTimeFormatInfo = dtf
FpSpread1.Sheets(0).AutoFilterMode = FarPoint.Win.Spread.AutoFilterMode.FilterBar
FpSpread1.Sheets(0).FilterBar.Cells(0).CellType = fbcell
FpSpread1.Sheets(0).Cells(0, 0).Value = "10/10/2014"
FpSpread1.Sheets(0).Columns(0).CellType = New FarPoint.Win.Spread.CellType.DateTimeCellType()
'Select a date filter (such as before or after) to see the icon
Dim wrkbk As FarPoint.Win.Spread.SpreadView = FpSpread1.GetRootWorkbook()
wrkbk.SetImage(FarPoint.Win.Spread.SpreadView.FilterBarFilterDateTime, Image.FromFile("C:\cut.png"))
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10

See Also

Reference

SpreadView Class
SpreadView Members

 

 


Copyright © GrapeCity, inc. All rights reserved.