Class MainWeb

MainWeb class

public class MainWeb : ExtWebControl, INamingContainer, IPostBackDataHandler, 
    IPostBackEventHandler, ISerializable

Constructors

NameDescription
MainWeb()The default constructor.

Properties

NameDescription
ActiveCell { get; set; }Gets or sets the active cell of the current sheet. Changed to be writable since version 1.9.0.1.
ActiveCellBgColor { get; set; }Specifies the background color of the active cell.
ActiveCellColor { get; set; }Specifies the color of the active cell.
ActiveHeaderBgColor { get; set; }Specifies the background color of the active row/column header.
ActiveHeaderColor { get; set; }Specifies the color of the active row/column header.
ActiveSheet { get; }Gets the active sheet
ActiveSheetIndex { get; set; }Gets or sets the active sheet index. Equal to the WebWorksheets.ActiveSheetIndex.
ActiveTabStyle { get; set; }Specifies the style of the active tab.
ACWClientPath { get; set; }Gets or sets the web path of the script/image files of the control. For example: “http://localhost/acw_client”. You may also set this value in the web.config file. Add this section to the <configuration> section:<appSettings>``<add key="aspose.cells.gridweb.acw_client_path" value="/acw_client/" />``</appSettings>
ACWLanguageFileUrl { get; set; }Gets or sets the web url of the language file of the control. For example: “/acw_client/lang_en.js”. By default, a built-in english file is used.
AutoRefreshChart { get; set; }Gets or sets whether the Chart image is updated while updating the cell value.the default is true
BottomTableStyle { get; set; }Gets or sets the style of the bottom bar of the control.
CurrentPageIndex { get; set; }
CustomCalculationEngine { get; set; }Represents user’s custom calculation engine to extend the default calculation engine of Aspose.Cells.
CustomCommandButtons { get; }
CustomStyleFileName { get; set; }Gets or sets the custom style file name.
DefaultFontName { get; set; }Gets or sets the control’s default font name.
DefaultFontSize { get; set; }Gets or sets the control’s default font size.
DefaultGridLineColor { get; set; }Gets or sets the default grid line’s color.
DisplayCellTip { get; set; }
EditMode { get; set; }Gets or sets the control’s edit mode.
EnableAJAX { get; set; }
EnableAsync { get; set; }Gets or sets whether load cells data in asynchronous way,suggest to apply for one sheet with more than 10000 cells.
EnableClientColumnOperations { get; set; }Gets or sets whether to enable the client side column operations.
EnableClientFreeze { get; set; }Gets or sets whether to enable the client side freezing operations.
EnableClientMergeOperations { get; set; }Gets or sets whether to enable the client side merge operations.
EnableClientResizeColumnRow { get; set; }Gets or sets whether to enable the client side resize column and row.
EnableClientRowOperations { get; set; }Gets or sets whether to enable the client side row operations.
EnableDoubleClickEvent { get; set; }Gets or sets whether to enable customer side double-click event.
EnableMetalLightEffect { get; set; }Gets or sets whether to apply metal light effect.
EnablePaging { get; set; }Gets or sets whether to enable the control’s paging mode.
EnableStyleDialogbox { get; set; }Gets or sets whether to enable the client side style dialogbox.
FilteredPaging { get; set; }Gets or sets whether to enable the paging after data filtered,will take affect when EnablePaging is true.
ForceValidation { get; set; }Gets or sets whether to force customer side validation.
FrameTableStyle { get; set; }Gets or sets the frame style of the control.
GoonDefaultSaveOperation { get; set; }Gets or sets whether GridWeb will do the default save operation ,the default value is true.
HeaderBarHeight { get; set; }Gets or sets the height( System.Web.UI.WebControl.Unit ) of the top header bar of the control.
HeaderBarStyle { get; set; }Gets or sets the header bar’s style.
HeaderBarTableStyle { get; set; }Gets or sets the header bar style of the control.
HeaderBarWidth { get; set; }Gets or sets the width( System.Web.UI.WebControl.Unit ) or the left header bar of the control.
override Height { get; set; }Gets or sets the height( System.Web.UI.WebControl.Unit ) of the control.
IgnoreStyleWithNoData { get; set; }Gets or sets whether GridWeb ignores showing rows or columns that do not contain cell values but are still styled. If set to true, the performance will be better. The default value is false, which means that if the last consecutive row/column has no cell values but is styled, we will still display them. This option is only valid when EnableAsync is false. This option has no effect when EnableAsync is true, which means GridWeb will show all rows/columns with style.
IsCalculateFormula { get; set; }Gets or sets whether to calculate formula after cell value changes or after import File. The default value is true.
IsPostBack { get; }Gets a value indicating whether gridweb is being loaded in response to a client postback, or if it is being loaded and accessed for the first time.
LinksTable { get; }
LoadOptions { get; set; }Represents the loadoptions for GridWeb.
MaxColumn { get; set; }Gets or sets the maximum display column index(zero based) of the web sheet. The control uses the greater value of MaxColumn and sheet data’s max column.
MaxRow { get; set; }Gets or sets the maximum display row index(zero based) of the web sheet. The control uses the greater value of MaxRow and sheet data’s max row.
Message { get; set; }
MinColumn { get; set; }
MinRow { get; set; }Gets or sets the minimum display row index(zero based) of the web sheet. The control uses the smaller value of MinRow and sheet data’s min row.
ModifiedCells { get; }Gets the collection of the cells that modified by the client.
NeedRenderGroupRows { get; set; }Gets or sets whether to show grouprows .
NoHScroll { get; set; }Gets or sets a value indicating whether the horizontal scroll bar is hidden.
NoScroll { get; set; }
NoVScroll { get; set; }Gets or sets a value indicating whether the vertical scroll bar is hidden.
OnAjaxCallFinishedClientFunction { get; set; }Gets or sets the client side function name to be called when ajaxcall finished. The client function should be declared like this: function GridAjaxcallFinished() { alert(this.id+" ajaxcall finished “); }Note: You may use the “this” pointer in the client function to point the grid control which fires the event.
OnCellErrorClientFunction { get; set; }Gets or sets the client side function name to be called when a cell’s validation is failed. The client function should be declared like this: function MyOnCellError(cell) { alert(this.getCellValueByCell(cell)); }Note: You may use the “this” pointer in the client function to point the grid control which fires the event.
OnCellSelectedAjaxCallBackClientFunction { get; set; }Gets or sets the client side function to be called when a cell is selected. The client function should be declared like this: function MyOnSelectCellAjaxCallBack(cell,customerdata) { }Note: You may use the “this” pointer in the client function to point the grid control which fires the event.
OnCellSelectedClientFunction { get; set; }Gets or sets the client side function to be called when a cell is selected. The client function should be declared like this: function MyOnSelectCell(cell) { GridWeb1.setCellValueByCell(cell, “test”); }Note: You may use the “this” pointer in the client function to point the grid control which fires the event.
OnCellUnselectedClientFunction { get; set; }Gets or sets the client side function to be called when a cell is unselected. The client function should be declared like this: function MyOnUnselectCell(cell) { this.setCellValueByCell(cell, “test”); }Note: You may use the “this” pointer in the client function to point the grid control which fires the event.
OnCellUpdatedClientFunction { get; set; }Gets or sets the client side function name to be called when a cell’s value is updated. The client function should be declared like this: function MyOnCellUpdated(cell) { alert(this.getCellValueByCell(cell)); }Note: You may use the “this” pointer in the client function to point the grid control which fires the event.
OnContextMenuShowClientFunction { get; set; }Gets or sets the client side function to be called when the context menu will be shown. The client function should be declared like this: function onContextMenuShow() { var menu = event.srcElement; menu.setItemVisibility(“Delete”, “block”); menu.setItemVisibility(“Update”, “none”); }Note: You may use the “this” pointer in the client function to point the grid control which fires the event.
OnDoubleClickCellClientFunction { get; set; }Gets or sets the client side function to be called when a cell is double clicked. The client function should be declared like this: function MyOnDoubleClickCell(cell) { this.setCellValueByCell(cell, “test”); }Note: You may use the “this” pointer in the client function to point the grid control which fires the event.
OnDoubleClickRowClientFunction { get; set; }Gets or sets the client side function to be called when a row is double clicked. The client function should be declared like this: function MyOnRowDoubleClick(row) { alert(row); }Note: You may use the “this” pointer in the client function to point the grid control which fires the event.
OnGridInitClientFunction { get; set; }Gets or sets the client side function name to be called when the grid is initialized. The client function should be declared like this: function MyOnGridInit(grid) { alert(“The grid is initialized: " + grid.id); }Note: You may use the “this” pointer in the client function to point the grid control which fires the event.
OnlyAuto { get; set; }Gets or sets whether only fit the rows which height are not customed,the default value is false
OnPageChangeClientFunction { get; set; }Gets or sets the client side function to be called after page index changing.only take effect when EnablePaging is true. The client function should be declared like this: function MyOnPageChange(index) { console.log(“current page is:"+index); }Note: You may use the “this” pointer in the client function to point the grid control which fires the event.
OnPageSubmitClientFunction { get; set; }Gets or sets the client function to be called before the page is submitted at client side.
OnShapeSelectedClientFunction { get; set; }Gets or sets the client side function to be called when a shape is selected. The client function should be declared like this: function MyOnSelectShape(shape) { var name=shape.getAttribute(“namevalue”) var text=shape.getAttribute(“textvalue”) var value=shape.getAttribute(“controlvalue”) var type=shape.getAttribute(“msotype”) }Note: You may use the “this” pointer in the client function to point the grid control which fires the event.
OnSubmitClientFunction { get; set; }Gets or sets the client function to be called before the control is submitted at client side. The client function should be declared like this: function MyOnSubmit(arg, cancelEdit) { return true;} The arg is the submit argument, contains the command to be post to the server. The cancelEdit is boolean value indicates whether the control has discarded the user input before submit. The control will continue submitting if the function returns true. Note: You may use the “this” pointer in the client function to point the grid control which fires the event.
PageSize { get; set; }Gets or sets the page size in paging mode.
PicturesTable { get; }
PresetStyle { get; set; }Gets or sets the preset style.
RefreshValidation { get; set; }Gets or sets whether to refresh validation value after cell value changes.
RenderHiddenRow { get; set; }Gets or sets whether the hidden row is rendered in GridControl,the default value is false. if you need to unhide the hidden row latter ,you shall set it as true
RowHeightForCSV { get; set; }Get or Set the row height value in point for csv file ,default value is 14.5.
ScrollBarArrowColor { get; set; }Specifies the color of the scrollbar’s arrow button.
ScrollBarBaseColor { get; set; }Specifies the color of the scroll bar of the control.
SelectCellBgColor { get; set; }Specifies the background color of the selected cells in multi-select range.
SelectCellColor { get; set; }Specifies the color of the selected cells in multi-select range.
SessionLoaded { get; set; }
SessionMode { get; set; }Gets or sets the session mode of the grid.
SessionSaved { get; set; }
SessionStorePath { get; set; }Gets or sets the session cache store path when session mode is File or ViewState, etc: gridweb.SessionStorePath=“c:/mytempdir/session”; then it will store session data in c:/mytempdir/session
Settings { get; set; }Represents the workbook settings.
ShapesTable { get; }
ShowAddButton { get; set; }Gets or sets whether to show the add worksheet button.
ShowBottomBar { get; set; }Specifies whether to show the command bar(includes command bar and tab bar) at the bottom of the control.
ShowCellEditBox { get; set; }whether Gridweb shows edit box toolbar as in MS-EXCEL.if enable ,a edit box for current cell will display in Gridweb. if we enable this feature, we need to import jquery js library in your aspx files to support this new feature. all the latest jquery version is ok. etc.
ShowCommandBarAtTop { get; set; }Specifies whether to show the command bar(includes command bar and tab bar) at the top of the control.
ShowContextMenu { get; set; }
ShowDefaultGridLine { get; set; }Gets or sets whether to show the default grid lines of the cells.
ShowHeaderBar { get; set; }
ShowLoading { get; set; }Specifies whether to show a loading dialogbox while postbacking to server.
ShowLoadingPosition { get; set; }Specifies the left,top postion(in px) to show the loading dialogbox while postbacking to server ,etc. 100,200 means the loading dialogbox’s left,top postion is at 100px,200px .
ShowSaveButton { get; set; }Gets or sets whether to show the save button.
ShowSubmitButton { get; set; }Gets or sets whether to show the submit button.
ShowTabBar { get; set; }
ShowTabNavigation { get; set; }Gets or sets whether the tab navigation button is show,the default value is true.
ShowUndoButton { get; set; }Gets or sets whether to show the undo button.
SpanWrap { get; set; }Specifies whether to wrap content in the cell span.the default value is true.
TabStyle { get; set; }Gets or sets the style of the tab bar.
UseClientPageHeight { get; set; }Gets or sets whether gridweb use client page height as control height ,suitable for when set Height=“100%",default value is false
ValidationsTable { get; }
ViewPanelScrollLeft { get; set; }Gets or sets the position of the scroll bar of the grid’s view panel.
ViewPanelScrollTop { get; set; }Gets or sets the position of the scroll bar of the grid’s view panel.
ViewTableStyle { get; set; }Gets or sets the data view panel’s style.
WebWorksheets { get; }
override Width { get; set; }Gets or sets the width( System.Web.UI.WebControl.Unit ) of the control.
WorkSheets { get; }
XhtmlMode { get; set; }
static DPI { get; set; }Gets /Sets the DPI of the machine.
static PictureCachePath { get; set; }Gets or sets the image storage path for the workbook,all the shapes,images will be stored in this directory, the default path is acwcache under current application Base Directory users need to implement a schedule service to clean the files those are out of session time.

Methods

NameDescription
CalculateFormula()Calculates the result of formulas.
override DataBind()Bind the control and all its child contorls to the its datasource.
override Dispose()
ImportExcelFile(Stream)Imports from an excel file stream, including disk file stream or memory stream.
ImportExcelFile(string)Imports from an excel file.
ImportExcelFile(Stream, string)Imports from an excel file stream, including disk file stream or memory stream.
ImportExcelFile(string, string)Imports from an excel file.
LoadCSVFile(Stream)Loads data from a CSV file stream.
LoadCSVFile(string)Loads data from a CSV file.
LoadHTMLFile(Stream)Loads data from a HTML file stream.
LoadHTMLFile(string)Loads data from a HTML file.
LoadSpreadSheetMLFile(Stream)Loads data from a SpreadSheetML file stream.
LoadSpreadSheetMLFile(string)Loads data from a SpreadSheetML file.
RefreshChartShape()refresh all the chart image for the active worksheet .
override RenderBeginTag(HtmlTextWriter)
SaveCSVFile(Stream)Saves data to a CSV file stream.
SaveCSVFile(string)Saves data to a CSV file.
SaveCustomStyleFile(string)Saves current style data of the control to an xml file. Can be used to create your customized style file.
SaveHTMLFile(Stream)Saves data to a HTML file stream.
SaveHTMLFile(string)Saves data to a HTML file.
SaveSpreadSheetMLFile(Stream)Saves data to a SpreadSheetML file stream.
SaveSpreadSheetMLFile(string)Saves data to a SpreadSheetML file.
SaveToExcelFile(Stream)Saves the worksheets to an excel file.
SaveToExcelFile(string)Saves the worksheets to an excel file with Excel 2003 format.
SaveToExcelFile(Stream, GridSaveFormat)Saves the worksheets to an excel file.
SaveToExcelFile(Stream, GridSaveOptions)Saves the worksheets to an excel file.
SaveToExcelFile(string, GridSaveFormat)Saves the worksheets to an excel file.
SaveToExcelFile(string, GridSaveOptions)Saves the worksheets to an excel file.
SetCustomStyle(Stream)sets the custom style file from stream including disk file stream or memory stream.

Events

NameDescription
event AfterColumnFilterOccurs after the column filtered.
event AjaxCallFinishedFires when the ajax update of the control finished.(the EnableAJAX shall be set to true)
event BeforeColumnFilterOccurs before the column to be filtered.
event CellClickOnAjaxOccurs when the cell is clicked,and need to do ajaxcallback for this event.
event CellClientUpdateOccurs when a client cell update happen . When this event is fired, its parameter e.Argument contains the command’s name.
event CellCommandOccurs when a cell’s command hyperlink is clicked. When this event is fired, its parameter e.Argument contains the command’s name.
event CellDoubleClickOccurs when the cell is double-clicked.
event CellErrorOccurs when a cell’s input value error.
event CellModifiedOnAjaxOccurs when the cell is modified in ajaxcall.
event ColumnDeletedOccurs when user delete a column from client-side menu.
event ColumnDeletingOccurs when user is trying to delete a column from the client-side menu. You may handle this event and set the cancel parameter to True to cancel a deleting operation.
event ColumnDoubleClickOccurs when the column header is double-clicked.
event ColumnInsertedOccurs when user insert a column from client-side menu.
event CustomCommandOccurs when user clicks a custom command button.
event LoadCustomDataFires when the control’s SessionMode is set to Custom and needs to load sheet data. You may handle this event in Custom Session mode to load sheet data from file or database.
event PageIndexChangedOccurs when the control’s sheet page index changed.
event RowDeletedOccurs when user has deleted a row from client-side menu.
event RowDeletingOccurs when user is trying to delete a row from the client-side menu. You may handle this event and throw a RejectDeleteException exception to cancel a deleting operation.
event RowDoubleClickOccurs when the row header is double-clicked.
event RowInsertedOccurs when user insert a row from client-side menu.
event SaveCommandOccurs when the “save” button is clicked.
event SheetAddedOccurs when user add a worksheet from toolbar menu.
event SheetDataUpdatedOccurs when the control has loaded the posted data and updated the sheet data.
event SheetTabClickOccurs when the sheet tab is clicked.
event SubmitCommandOccurs when the “submit” button is clicked.
event UndoCommandOccurs when the “undo” button is clicked.

See Also