Spread for ASP. NET 7 new function User Guide

Source: Internet
Author: User

The Spread for ASP. NET table control is compatible with the powerful functions of Excel and embedded in your application system. Complete Excel documentation support allows you to share and access data information in your enterprise; the built-in chart engine and data visualization support allows you to create a rich and efficient information center for business, engineering, and scientific application systems. The new version 7 provides several major updates, including:

  • Context Menu

  • RowTemplate

  • Css for cell Editor

  • Performance Improvement

  • Other Spread for ASP. NET enhancements

    • Add independent edit mode and non-edit mode for the DateTime, Currency, Double, and Integer cell types.

    • Enhance the virtual page to support scroll bar text prompts.

    • Pagination of rows and columns is supported during printing.

    • Supports locking and unlocking client scripts.

    • The Cell. EncodeValue attribute is added. You can directly enter the original HTML tag in the Cell text.

    • The client supports setting cell values in hidden rows or columns.

    • Added support for ClientIDMode.

     

     

     

Context Menu

Spread for ASP. the context menu embedded in. NET replaces the context menu provided by the browser. You can add more data mining and interface interaction functions to your application through the context menu feature of Spread.

650) this. width = 650; "style =" border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px "title =" clip_image002 "border =" 0 "alt =" clip_image002 "src =" http://www.bkjia.com/uploads/allimg/131228/16163Q3S-0.jpg "width =" 580 "height =" 361 "/>

You can customize context menu options to set the height and other attributes. You can use the ContextMenuType enumeration to set the menu type. You can create a context menu through foreground attribute settings or the day after tomorrow code.

The CommandArgument attribute and CommandCode attribute are used to set the click menu attribute. It can also be used in the MenuItemClicked event.

Create with attribute form:

  • Select Spread in the attribute form

  • Select the ContextMenus attribute

  • In the displayed dialog box, edit the menu item.

  • After editing, click "OK" to exit.

650) this. width = 650; "style =" width: 700px; display: inline; height: 297px "title =" clip_image003 "border =" 0 "hspace =" 0 "alt =" clip_image003 "src =" http://www.bkjia.com/uploads/allimg/131228/16163U064-1.gif "width =" 700 "height =" 297 "/>

Create with code:

HTML Tag:

<ContextMenus> <FarPoint: ContextMenu Type = "Viewport"> <Items> <FarPoint: MenuItem Text = "menu 1"> </FarPoint: MenuItem> <FarPoint: menuItem Text = "menu 2"> </FarPoint: MenuItem> <FarPoint: MenuItem Text = "menu 3"> </FarPoint: MenuItem> </Items> </FarPoint: contextMenu> </ContextMenus>

C # code:

If (this. isPostBack) return; FpSpread1.EnableContextMenu = true; // create a normal cell menu FarPoint. web. spread. contextMenu viewportMenu = FpSpread1.ContextMenus [FarPoint. web. spread. contextMenuType. viewport]; FarPoint. web. spread. menuItem customViewportItem = new FarPoint. web. spread. menuItem ("Level 2 menu"); customViewportItem. childItems. add (new FarPoint. web. spread. menuItem ("level-2 menu item 1"); customViewportItem. childItems. add (new FarPoint. web. spread. menuItem ("Level 2 menu item 2"); viewportMenu. items. add (customViewportItem); // create the row header cell menu FarPoint. web. spread. contextMenu rowHeaderContextMenu = new FarPoint. web. spread. contextMenu (); rowHeaderContextMenu. type = FarPoint. web. spread. contextMenuType. rowHeader; FarPoint. web. spread. menuItem rowHeaderItem = new FarPoint. web. spread. menuItem ("line header menu"); rowHeaderItem. childItems. add (new FarPoint. web. spread. menuItem ("menu 1"); rowHeaderItem. childItems. add (new FarPoint. web. spread. menuItem ("menu 2"); rowHeaderContextMenu. items. add (rowHeaderItem); FpSpread1.ContextMenus. add (rowHeaderContextMenu );

650) this. width = 650; "style =" display: inline "title =" clip_image004 "alt =" clip_image004 "src =" http://www.bkjia.com/uploads/allimg/131228/16163V4A-2.gif "height =" 398 "/>

For more new features, see Online Demo instances:

Http://www.gcpowertools.com.cn/LiveSamples/Spread/ASPNET/sampleexplorer/samples/ContextMenu/Overview.aspx

RowTemplate

Spread for ASP. NET adds a new column header template for RowTemplate. In this way, the column header cell can have a completely different layout style than the data row. You can change the traditional Spread layout to display one piece of data in multiple rows. The multi-row layout is controlled by the row template, which can be customized by code or Spread designer.

In this article, we will describe how to use code to add a row template layout that has been bound to a table control Spread data source.

650) this. width = 650; "style =" width: 700px; display: inline; height: 427px "title =" clip_image005 "border =" 0 "hspace =" 0 "alt =" clip_image005 "src =" http://www.bkjia.com/uploads/allimg/131228/16163V410-3.gif "width =" 700 "height =" 427 "/>

1. We can use WorksheetTemplate to implement row template layout.

First, you must set the target form template as the row layout template:

sheet.LayoutMode = FarPoint.Web.Spread.SheetView.LayoutModeType.RowTemplateLayoutMode;

Then, set the row layout template:

// Sets the row layout template sheet. worksheetTemplate. columnCount = 4; sheet. worksheetTemplate. rowTemplate. rowCount = 2; sheet. worksheetTemplate. columnHeaderTemplate. rowCount = 1; sheet. worksheetTemplate. layoutColumns [0]. width = 100; sheet. worksheetTemplate. layoutColumns [1]. width = 100; sheet. worksheetTemplate. layoutColumns [2]. width = 70; sheet. worksheetTemplate. layoutColumns [3]. length = 300;

Finally, we need to set the display sequence of the data source fields in the row template.

// Set the data field sequence sheet in the row layout template. worksheetTemplate. layoutCells [0, 0]. dataIndex = 1; sheet. worksheetTemplate. layoutCells [0, 1]. dataIndex = 2; sheet. worksheetTemplate. layoutCells [1, 0]. dataIndex = 3; sheet. worksheetTemplate. layoutCells [0, 2]. dataIndex = 6; sheet. worksheetTemplate. layoutCells [0, 3]. dataIndex = 4; sheet. worksheetTemplate. layoutCells [1, 3]. dataIndex = 5;

Ii. Set the Spread Data source:

// Obtain the data DataTable employees = new DataTable ("Employees") from the data source; using (OleDbConnection connection = new OleDbConnection (@ "Provider = Microsoft. jet. OLEDB.4.0; Data Source = | DataDirectory | \ Northwind. mdb; Persist Security Info = True ") {using (OleDbDataAdapter adapter = new OleDbDataAdapter (" SELECT EmployeeID, FirstName, LastName, Title, Address, HomePhone FROM Employees ", connection )) {adapter. fill (employees) ;}} employees. columns. add (new DataColumn ("Photo"); // set the data source FpSpread1.DataSource = employees through the DataSource attribute in the FpSpread class;

For more new features, see Online Demo instances:

Http://www.gcpowertools.com.cn/LiveSamples/Spread/ASPNET/sampleexplorer/samples/RowTemplateLayout/Overview.aspx

Css for cell Editor

Before the table control Spread for ASP. NET 7, we cannot set the format of cells in editing mode. The cell content will not be formatted until you click "Update. Now, "editing and formatting support" is added in V7 to allow users to customize editing formats, such as numeric or date formats, which undoubtedly enhances user experience.

650) this. width = 650; "style =" width: 700px; display: inline; height: 427px "title =" clip_image006 "border =" 0 "hspace =" 0 "alt =" clip_image006 "src =" http://www.bkjia.com/uploads/allimg/131228/16163U2S-4.gif "width =" 700 "height =" 427 "/>

The following describes how to set the "Edit format" of cells ".

You can use the EditorCssClass attribute of Spread for ASP. NET to set the Editable cell type. Use Css code to set the style of the cell type editor. It is independent of the cell display mode customized through the CssClass attribute.

You can use the EditMode attribute of each cell type to set the Spread editing format of the table control. The following uses CurrencyCellType as an example.

// Set the cell type FarPoint. web. spread. currencyCellType cct = new FarPoint. web. spread. currencyCellType (); cct. numberFormat = new System. globalization. numberFormatInfo (); cct. numberFormat. currencySymbol = "USD ";

First, set the cell type. The Code is as follows:

// Set the cell type FarPoint. web. spread. currencyCellType cct = new FarPoint. web. spread. currencyCellType (); cct. numberFormat = new System. globalization. numberFormatInfo (); cct. numberFormat. currencySymbol = "USD ";

You can double-click the cell to edit the cell. After the cell enters the editing status, the format disappears:

650) this. width = 650; "style =" width: 700px; display: inline; height: 427px "title =" clip_image007 "border =" 0 "hspace =" 0 "alt =" clip_image007 "src =" http://www.bkjia.com/uploads/allimg/131228/16163Q0X-5.gif "width =" 700 "height =" 427 "/>

Then, set the cell type editing mode:

// Set the edit format of the cell type to cct. EditMode. NumberFormat = new System. Globalization. NumberFormatInfo (); cct. EditMode. NumberFormat. CurrencySymbol = "$ ";

As follows:

650) this. width = 650; "style =" width: 700px; display: inline; height: 427px "title =" clip_image008 "border =" 0 "hspace =" 0 "alt =" clip_image008 "src =" http://www.bkjia.com/uploads/allimg/131228/16163Q2I-6.gif "width =" 700 "height =" 427 "/>

The above is the new feature of Spread for ASP. NET 7-editing format.

For more new features, see Online Demo instances:

Http://www.gcpowertools.com.cn/LiveSamples/Spread/ASPNET/sampleexplorer/samples/EditModeFormat/Overview.aspx

Performance Improvement

· Added the LoadOnDemandMode attribute to support loading data through the background before the user scrolls to the last row. The TriggerMode attribute is added to support timed loading and cross-border loading.

· Improved the performance of rendering tables, PDF files, and importing Excel files.

· Improves client rolling performance, loads data on demand in the background, and triggers new client events.

· Enhanced virtual scrolling, which can keep extra data from the previous page when loading new data.

· Supports asynchronous rendering of charts.

· Optimize the Script Loading time by merging JS and CSS.

· The use of parallel job libraries improves key performance.

650) this. width = 650; "style =" border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px "title =" clip_image010 "border =" 0 "alt =" clip_image010 "src =" http://www.bkjia.com/uploads/allimg/131228/16163T440-7.jpg "width =" 580 "height =" 642 "/>

For more details about Spread Studio for. NET products, see: http://www.gcpowertools.com.cn/products/Spread_Studio.htm

This article from the "grape city control blog" blog, please be sure to keep this source http://powertoolsteam.blog.51cto.com/2369428/1208813

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.