You can use the GcDateTime cell to display date and time values. The GcDateTime cell allows the user to pick a date from a calendar drop-down or type in the cell. This cell is part of the GrapeCity.Win.PluginInputMan assembly.
The GcDateTime cell supports different calendar styles from the DateTime cell. You can specify which fields to display with the DisplayFields property.
You can specify the focus position when the cell gets focus with the FocusPosition property and you can specify whether focus leaves the cell after typing the last character in the date value with the ExitOnLastChar property.
You can use the ShortcutKeys property to map keys to actions for the GcDateTime and GcTextBox cells. In edit mode, these shortcut keys have precedence over the Spread input maps. The cell uses the Spread input maps when not in edit mode.
You can specify the type of drop-down to display with the DropDownType property. The drop-down picker type is easier to use in a touch environment.
For a complete list of properties, see the GcDateTimeCellType class.
This example creates a GcDateTime cell.
C# |
Copy Code
|
---|---|
GrapeCity.Win.Spread.InputMan.CellType.GcDateTimeCellType inputcell = new GrapeCity.Win.Spread.InputMan.CellType.GcDateTimeCellType(); inputcell.EditMode = GrapeCity.Win.Spread.InputMan.CellType.EditMode.Overwrite; fpSpread1.Sheets[0].Cells[0, 0].CellType = inputcell; |
VB |
Copy Code
|
---|---|
Dim inputcell As New GrapeCity.Win.Spread.InputMan.CellType.GcDateTimeCellType inputcell.EditMode = GrapeCity.Win.Spread.InputMan.CellType.EditMode.Overwrite fpSpread1.Sheets(0).Cells(0, 0).CellType = inputcell |
Or right-click on the cell or cells and select Cell Type. From the list, select GcDateTime. In the CellType editor, set the properties you need. Click Apply.