Using Farpoint Web Spread custom Celltype in. Net

Source: Internet
Author: User
Tags string format

On the internet about Farpoint articles are not many, their own development of useful to, write to summarize.

FarPoint.Web.Spread can control the celltype you need in the cell. But sometimes we face a variety of needs, perhaps its own celltype does not meet our needs, then we can choose to customize the Celltype.

An example of a custom htmlinputbuttoncelltype:

<serializable () > Public Class pinbuttoncelltype Inherits FarPoint.Web.Spread.BaseCellType public Value as Stri  Ng public OnClick As String public Overrides Function Paintcell (ByVal ID As String, ByVal parent as TableCell, ByVal Style as FarPoint.Web.Spread.Appearance, ByVal margin as FarPoint.Web.Spread.Inset, ByVal Val as Object, ByVal ul as Bool EAN) as System.Web.UI.Control "Manual realize JS function on client Fpcelltype value + _getvalue (RD) _seteditorvalue (Ed, V AL) _geteditorvalue (ed) _setvalue (Rd,val)         Parent.        Attributes.Add ("Fpcelltype", "pinbuttoncelltype") Dim lit as New System.Web.UI.HtmlControls.HtmlInputButton Lit. Value = value lit. Attributes.Add ("onclick", String.Format (onclick, Val)) Return lit End function public Overrides function Gete Ditorcontrol (ByVal ID as String, ByVal TC as TableCell, ByVal style as FarPoint.Web.Spread.Appearance, ByVal margin as far Point.Web.Spread.Inset, ByVal v as Object, ByVal ul as Boolean) as System.Web.UI.Control Return nothing End Func tion public Overrides Function Geteditorvalue (ByVal owner as Control, ByVal ID as String) as Object Return Mybas  E.geteditorvalue (owner, id) End Function public Overrides function format (ByVal o as Object) as String Format = Mybase.format (o) End Function public Overrides function parse (ByVal s as String) as Object parse = MyBase. Parse (s) End function Public Function getvaluefromtext (ByVal s as String) as Object GetvaLuefromtext = s End functionend Class 

Examples of Use:

' button name ' onclick functionfpsDemo.ActiveSheetView.Columns (0). Celltype = Btncelltype

Using Farpoint Web Spread custom Celltype in. Net

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.