To set cell types, for each custom cell type, you have to create a cell type object, set the properties for it, and then assign that object to the CellType property for a cell or range of cells.
C# |
Copy Code
|
---|---|
// Create Check # column of integer cells. FarPoint.Web.Spread.IntegerCellType objIntCell = new FarPoint.Web.Spread.IntegerCellType(); FpSpread1.Sheets[0].Columns[0].CellType = objIntCell; |
VB |
Copy Code
|
---|---|
' Create Check # column of integer cells. Dim objIntCell As New FarPoint.Web.Spread.IntegerCellType() FpSpread1.Sheets(0).Columns(0).CellType = objIntCell |
C# |
Copy Code
|
---|---|
// Create Date column of date-time cells. FarPoint.Web.Spread.DateTimeCellType objDateCell = new FarPoint.Web.Spread.DateTimeCellType(); objDateCell.FormatString = "M/dd/yyyy"; FpSpread1.Sheets[0].Columns[1].CellType = objDateCell; |
VB |
Copy Code
|
---|---|
' Create Date column of date-time cells. Dim objDateCell As New FarPoint.Web.Spread.DateTimeCellType() objDateCell.FormatString ="M/dd/yyyy" FpSpread1.Sheets(0).Columns(1).CellType = objDateCell |
C# |
Copy Code
|
---|---|
// Create Description column of general cells. FarPoint.Web.Spread.GeneralCellType objGenCell = new FarPoint.Web.Spread.GeneralCellType(); FpSpread1.Sheets[0].Columns[2].CellType = objGenCell; |
VB |
Copy Code
|
---|---|
' Create Description column of general cells. Dim objGenCell As New FarPoint.Web.Spread.GeneralCellType() FpSpread1.Sheets(0).Columns(2).CellType = objGenCell |
C# |
Copy Code
|
---|---|
/// Create Tax? and Cleared? columns of check box cells. FarPoint.Web.Spread.CheckBoxCellType objCheckCell = new FarPoint.Web.Spread.CheckBoxCellType(); FpSpread1.Sheets[0].Columns[3].CellType = objCheckCell; FpSpread1.Sheets[0].Columns[4].CellType = objCheckCell; |
VB |
Copy Code
|
---|---|
' Create Tax? and Cleared? columns of check box cells. Dim objCheckCell As New FarPoint.Web.Spread.CheckBoxCellType() FpSpread1.Sheets(0).Columns(3).CellType = objCheckCell FpSpread1.Sheets(0).Columns(4).CellType = objCheckCell |
C# |
Copy Code
|
---|---|
// Create the Debit, Credit, and Balance columns of currency cells. FarPoint.Web.Spread.CurrencyCellType objCurrCell = new FarPoint.Web.Spread.CurrencyCellType(); FpSpread1.Sheets[0].Columns[5].CellType = objCurrCell; FpSpread1.Sheets[0].Columns[6].CellType = objCurrCell; FpSpread1.Sheets[0].Columns[7].CellType = objCurrCell; |
VB |
Copy Code
|
---|---|
' Create the Debit, Credit, and Balance columns of currency cells. Dim objCurrCell As New FarPoint.Web.Spread.CurrencyCellType() FpSpread1.Sheets(0).Columns(5).CellType = objCurrCell FpSpread1.Sheets(0).Columns(6).CellType = objCurrCell FpSpread1.Sheets(0).Columns(7).CellType = objCurrCell |
Your ASP.NET page should look similar to the following picture.