New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Server-side Programming Overview

RadSpreadsheet provides a rich set of server-side properties and events that can help you configure the look and behaviour of the control.

RadSpreadsheet Properties

Table 1 demonstrates some general properties of the RadSpreadsheet:

PropertyTypeDescription
ColumnHeaderHeightdoubleGets or sets the RadSpreadsheet column headers heigth in pixels.
ColumnWidthdoubleGets or sets the RadSpreadsheet column width in pixels.
ColumnsCountintGets or sets the number of columns in the RadSpreadsheet.
CultureSystem.Globalization.CultureInfoGets or sets the selected culture. Localization strings will be loaded based on this value.
LocalizationTelerik.Web.UI.SpreadsheetStringsGets the Localization.
LocalizationPathstringGets or sets a value indicating where RadSpreadsheet will look for its .resx localization files.
ProviderTelerik.Web.UI.SpreadsheetProviderBaseGets or sets the provider instance to be used by RadSpreadsheet. Use this property with providers that are created at runtime. For ASP.NET providers defined in web.config use the ProviderName property.
ProviderNamestringGets or sets the name of the current provider used by RadSpreadsheet. The provider must be defined in the spreadsheet section of web.config.
RowHeaderWidthdoubleGets or sets the RadSpreadsheet row headers width in pixels.
RowHeightdoubleGets or sets the RadSpreadsheet row height in pixels.
RowsCountintGets or sets the number of rows in the RadSpreadsheet.
SheetsList<Telerik.Web.Spreadsheet.Worksheet>Gets a collection of the Sheets currently loaded in the RadSpreadsheet.

You can use the Sheets and their rows/cells only if you use Programmatic Binding. When using a provider, such operations must be performed in the custom provider code.

Telerik.Web.Spreadsheet.Worksheet Properties and Methods

Table 2 demonstrates some general properties of the Telerik.Web.Spreadsheet.Worksheet object:

PropertyTypeDescription
ActiveCellstringThe active cell in the sheet, e.g. "A1".
ColumnsTelerik.Web.Spreadsheet.ColumnAn array defining the columns in this sheet and their content.
FilterTelerik.Web.Spreadsheet.FilterDefines the filtering criteria for this sheet, if any.
FrozenColumnsint?The number of frozen columns in this sheet, if any.
FrozenRowsint?The number of frozen rows in this sheet, if any.
MergedCellsList<string>List of all merged cells in the format "A1:B2".
NamestringThe name of the sheet.
RowsList<Telerik.Web.Spreadsheet.Row>The row data for this sheet.
SelectionstringThe selected range in the sheet, e.g. "A1:B10".
ShowGridLinesbool?A boolean value indicating if the sheet grid lines should be displayed.
SortTelerik.Web.Spreadsheet.SortDefines the sort criteria for the sheet.

Table 3 demonstrates some of the most important methods of the Telerik.Web.Spreadsheet.Worksheet object:

PropertyParametersReturn TypeDescription
AddMergedCellsstringvoidAdds a merged range to the worksheet.
AddRowTelerik.Web.Spreadsheet.RowvoidAdds a row to the worksheet.
ColumnHeaderHeightIEnumerable<Telerik.Web.Spreadsheet.Row>voidAdds rows to the worksheet.

Telerik.Web.Spreadsheet.Row Properties and Methods

Table 4 demonstrates some general properties of the Telerik.Web.Spreadsheet.Row object:

PropertyTypeDescription
CellsList<Telerik.Web.Spreadsheet.Cell>The cells within the current row.
Heightdouble?The row height in pixels. Defaults to rowHeight.
Indexint?The absolute row index. Required to ensure correct positioning.

Table 5 demonstrates some of the most important methods of the Telerik.Web.Spreadsheet.Row object:

PropertyParametersReturn TypeDescription
AddCellTelerik.Web.Spreadsheet.CellvoidAdds a cell to the row.
AddCellsIEnumerable<Telerik.Web.Spreadsheet.Cell>voidAdds the cells to the row.

Telerik.Web.Spreadsheet.Cell Properties

Table 6 demonstrates some general properties of the Telerik.Web.Spreadsheet.Cell object:

PropertyTypeDescription
BackgroundstringThe background color of the cell.Many standard CSS formats are supported, but the canonical form is "#ccff00".
Boldbool?Sets the cell font to bold, if set to true.
BorderBottomTelerik.Web.Spreadsheet.BorderStyleThe style information for the bottom border of the cell.
BorderLeftTelerik.Web.Spreadsheet.BorderStyleThe style information for the left border of the cell.
BorderRightTelerik.Web.Spreadsheet.BorderStyleThe style information for the right border of the cell.
BorderTopTelerik.Web.Spreadsheet.BorderStyleThe style information for the top border of the cell.
ColorstringThe font color of the cell.Many standard CSS formats are supported, but the canonical form is "#ccff00".
EditorstringThe custom editor of the cell.
Enabledouble?Disables or enables cell.
FontFamilystringThe font family for the cell.
FontSizedouble?The font size of the cell in pixels.
FormatstringThe format of the cell text.See Create or delete a custom number format on MS Office.
FormulastringThe cell formula without the leading equals sign, e.g. A1 * 10.
Indexint?The zero-based index of the cell. Required to ensure correct positioning.
Italicbool?Sets the cell font to italic, if set to true.
LinkstringThe hyperlink (URL) of the cell.
TextAlignstringThe text align setting for the cell content. Available options are: left, center, right or justify
Underlinebool?Sets the cell font to underline, if set to true.
ValidationTelerik.Web.Spreadsheet.ValidationThe Validation settings of the cell.
ValueobjectThe cell value.
VerticalAlignstringThe vertical align setting for the cell content. Available options are: * top * center * bottom.
Wrapbool?Will wrap the cell content if set to true.

Telerik.Web.Spreadsheet.Column Properties

Table 7 demonstrates some general properties of the Telerik.Web.Spreadsheet.Column object:

PropertyTypeDescription
Indexint?The zero-based index of the column. Required to ensure correct positioning.
Widthdouble?The width of the column in pixels. Defaults to columnWidth.

Telerik.Web.Spreadsheet.Filter Properties

Table 8 demonstrates some general properties of the Telerik.Web.Spreadsheet.Filter object:

PropertyTypeDescription
ColumnsList<Telerik.Web.Spreadsheet.FilterColumn>An array defining the filter configuration of individual columns.
RefstringThe active range for the filter, e.g. "B1:D8".

Telerik.Web.Spreadsheet.Sort Properties

Table 9 demonstrates some general properties of the Telerik.Web.Spreadsheet.Sort object:

PropertyTypeDescription
ColumnsList<Telerik.Web.Spreadsheet.SortColumn>Specifies the sort options for individual columns.
RefstringThe sorted range, e.g. "A1:D5".

See Also