Class GridWorksheet

GridWorksheet class

Encapsulates the object that represents a single worksheet.

public class GridWorksheet : Control, ISerializable

Properties

NameDescription
ActiveCell { get; set; }
BackgroundImage { get; set; }Gets and sets worksheet background image.
BindColumns { get; }Bind columns collection.
BindingSource { get; }The actually binding datasource object at run-time. It is a DataView object when the DataSource property is a DataSet, DataTable or DataView object.
BindStartColumn { get; set; }In data-binding mode, BindStartRow and BindStartColumn indicate the position of the grid to bind bo the datasource.
BindStartRow { get; set; }In data-binding mode, BindStartRow and BindStartColumn indicate the position of the grid to bind bo the datasource.
Cells { get; }
CodeName { get; }Represents worksheet code name.
Comments { get; }
CurrentBindRows { get; set; }Gets the binding rows number in data-binding mode.
DataMember { get; set; }Gets or sets the DataMember from the multi-member DataSource. Generally it represents a DataTable object of a DataSet.
DataSource { get; set; }Gets or sets the DataSource. Generally it’s a DataSet object.
DisplayRightToLeft { get; set; }
DisplayZeros { get; set; }True if zero values are displayed.
EnableCreateBindColumnHeader { get; set; }In data-binding mode, indicates whether to create bind column header captions in the sheet.
FirstVisibleColumn { get; set; }
FirstVisibleRow { get; set; }
GridActiveCell { get; set; }
Hyperlinks { get; }Gets the GridHyperlinkCollection collection.
Index { get; }
IsGridlinesVisible { get; set; }Gets or sets a value indicating whether the grid lines are visible.Default is true.
IsSummaryRowBelow { get; set; }Indicates if the summary row will be positioned below the detail rows in the outline.
Name { get; set; }Gets or sets the name of the worksheet.
OutlineShown { get; set; }Indicates whether show outline.
Pictures { get; }Gets a Pictures collection.
PivotTables { get; }Gets the pivotTables in the worksheet.
Selected { get; set; }Indicates whether this worksheet is selected when the workbook is opened.
Shapes { get; }Gets a Pictures collection.
StandardHeight { get; set; }Gets or sets the default row height in this worksheet,in unit of points.
StandardHeightPixels { get; set; }Gets or sets the default row height in this worksheet,in unit of pixels.
TabColor { get; set; }Represents worksheet tab color.
Validations { get; }Gets the data validation setting collection in the worksheet.
override Visible { get; set; }Indicates whether this sheet’s name is shown in the sheet tabs of the control.
Workbook { get; }
Zoom { get; set; }

Methods

NameDescription
AddAutoFilter(int, int, int)Sets the range to which the specified AutoFilter applies.
AddCustomFilter(int, string)Add custom filter for the specified row.
AutoFitColumn(int)Autofits the column width.
AutoFitColumn(int, int, int)Autofits the column width.
AutoFitRow(int)Autofits the row height.
AutoFitRow(int, int, int)Autofits the row height.
AutoFitRow(int, int, int, int)Autofits row height in a rectangle range.
AutoFitRows()Autofits all rows in this worksheet.
AutoFitRows(bool)Autofits all rows in this worksheet.
AutoFitRows(int, int)Autofits row height in a range.
CalculateFormula(string)Calculates a formula.
CancelNewBindRow()Cancels and deletes the new added bind row.
ClearComments()Clears all comments in designer spreadsheet.
CommitNewBindRow()Commits the new added bind row and add it to the datasource.
Copy(GridWorksheet)Copies contents and formats from another worksheet.
CreateAutoGenratedColumns()After setting a datasource for the worksheet, call this method to generate the bind columns automatically.
CreateNewBindRow()Creates a new bind row and bind to the datasource.
CreateSubtotal(int, int, int, SubtotalFunction, int[])Creates subtotal in the sheet.
CreateSubtotal(int, int, int, SubtotalFunction, int[], string, GridTableItemStyle, GridTableItemStyle, NumberType, string)Creates subtotal in the sheet.
override DataBind()Bind the sheet to the DataSource.
DataSourceControlUpdate(AccessDataSource)Bind the sheet to the DataSource.
DeleteBindRow(int)Deletes a bind row.
FilterString(int, string)Sets the filter for the column.notice we shall call AddAutoFilter before calling of filterString The filter criteria string. notice we use comma->"," as split char,so the cell value you want to filter shall not contains with comma filterString(10,“123,456”) means column 10 shall contain 123 or 456, filterString(10,“123”) means column10 shall contain 123 value split with comma,eg. 123,456,789 or abc
FreezePanes(string, int, int)Freezes panes at the specified cell in the worksheet.
FreezePanes(int, int, int, int)Freezes panes at the specified cell in the worksheet.
GetColumnCaption(int)Gets the column caption. If the caption is not set, returns empty string.
GetColumnHeaderToolTip(int)Gets the columnheader’s tooltip text.
GetColumnReadonly(int)Gets if a column is readonly. this is extended method of GridWeb specifically,it will not keep and take affect in actual excel file
GetFreezedPanes(out int, out int, out int, out int)Gets the freeze panes.
GetIsReadonly(int, int)Gets whether the cell is readonly.this is an extended attribute of GridWeb ,it will not keep in actual excel file
GetRowCaption(int)Gets the row caption. If the caption is not set, returns empty string.
GetRowHeaderToolTip(int)Gets the rowheader’s tooltip text.
GetRowReadonly(int)Gets if a row is readonly. this is extended method of GridWeb specifically,it will not keep and take affect in actual excel file
GroupRows(int, int, bool)Groups rows.
IsProtected()Indicates if the worksheet is protected.
MoveTo(int)Moves the sheet to another location in the spreadsheet.
RefreshFilter()Refresh auto filters to hide or unhide the rows.
RemoveAutoFilter()Remove the auto filter of the worksheet.
RemoveSubtotal()Removes subtotal created by the CreateSubtotal method in the sheet.
ResetFilter(int)The integer offset of the field on which you want to apply ,based on the first filter column (from the left of the list; the leftmost field is field 0).
SetAllCellsEditable()Makes all cells editable.this is extended attribute
SetAllCellsReadonly()Makes all cells readonly.this is extended attribute notice this attribute can not keep in actual cell,if you want to keep protect please use setProtect
SetColumnCaption(int, string)Sets the caption for the column.please note this is an extension attribute and can not keep in excel file
SetColumnHeaderToolTip(int, string)Sets the columnheader’s tooltip text.
SetColumnReadonly(int, bool)Sets a column to readonly so user can’t delete it from client side. this is extended method of GridWeb specifically,it will not keep and take affect in actual excel file
SetEditableRange(int, int, int, int)Makes a range of cells editable. http://docs.aspose.com:8082/docs/display/cellsnet/Protecting+Cells Make all cells read only by calling the SetAllCellsReadonly method. then call this method to Specify the range of cells that to be editable
SetIsReadonly(int, int, bool)Sets whether the cell is readonly.this is an extended attribute of GridWeb ,it will not keep in actual excel file
SetProtect()Protects worksheet.
SetReadonlyRange(int, int, int, int)Makes a range of cells readonly. http://docs.aspose.com:8082/docs/display/cellsnet/Protecting+Cells First make all cells editable by calling the SetAllCellsEditable method. then call this method to Specify the range of cells that to be readonly
SetRowCaption(int, string)Sets the caption for the row.
SetRowHeaderToolTip(int, string)Sets the rowheader’s tooltip text.
SetRowReadonly(int, bool)Sets a row to readonly so user can’t delete it from client side. this is extended method of GridWeb specifically,it will not keep and take affect in actual excel file
UnFreezePanes()Unfreezes panes in the worksheet.
UnGroupRows(int, int)Ungroups rows.
UnProtect()unProtects worksheet.

Events

NameDescription
event InitializeNewBindRowOccurs when the worksheet has created a new bind row and need to initialize it.

See Also