ASP.NET MVC - EJ2

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class SwitchBuilder

    Show / Hide Table of Contents

    Class SwitchBuilder

    Inheritance
    System.Object
    ControlBuilder
    SwitchBuilder
    Inherited Members
    ControlBuilder.Context
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.EJ2.Buttons
    Assembly: Syncfusion.EJ2.dll
    Syntax
    public class SwitchBuilder : ControlBuilder

    Constructors

    SwitchBuilder()

    Declaration
    public SwitchBuilder()

    SwitchBuilder(Switch)

    Declaration
    public SwitchBuilder(Switch model)
    Parameters
    Type Name Description
    Switch model

    Fields

    model

    Declaration
    public Switch model
    Field Value
    Type Description
    Switch

    Properties

    HtmlAttr

    Declaration
    public IDictionary<string, object> HtmlAttr { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.IDictionary<System.String, System.Object>

    ID

    Declaration
    public string ID { get; set; }
    Property Value
    Type Description
    System.String

    Output

    Declaration
    public override TextWriter Output { get; set; }
    Property Value
    Type Description
    System.IO.TextWriter
    Overrides
    ControlBuilder.Output

    Methods

    Change(String)

    Triggers when Switch state has been changed by user interaction.

    Declaration
    public SwitchBuilder Change(string change)
    Parameters
    Type Name Description
    System.String change
    Returns
    Type Description
    SwitchBuilder

    Checked(Boolean)

    Declaration
    public SwitchBuilder Checked(bool check = true)
    Parameters
    Type Name Description
    System.Boolean check
    Returns
    Type Description
    SwitchBuilder

    Created(String)

    Triggers once the component rendering is completed.

    Declaration
    public SwitchBuilder Created(string created)
    Parameters
    Type Name Description
    System.String created
    Returns
    Type Description
    SwitchBuilder

    CssClass(String)

    You can add custom styles to the Switch by using this property.

    Declaration
    public SwitchBuilder CssClass(string cssClass)
    Parameters
    Type Name Description
    System.String cssClass
    Returns
    Type Description
    SwitchBuilder

    Disabled(Boolean)

    Specifies a value that indicates whether the Switch is disabled or not. When set to true, the Switch will be in disabled state.

    Declaration
    public SwitchBuilder Disabled(bool disabled = true)
    Parameters
    Type Name Description
    System.Boolean disabled
    Returns
    Type Description
    SwitchBuilder

    EnablePersistence(Boolean)

    Enable or disable persisting component's state between page reloads.

    Declaration
    public SwitchBuilder EnablePersistence(bool enablePersistence = true)
    Parameters
    Type Name Description
    System.Boolean enablePersistence
    Returns
    Type Description
    SwitchBuilder

    EnableRtl(Boolean)

    Enable or disable rendering component in right to left direction.

    Declaration
    public SwitchBuilder EnableRtl(bool enableRtl = true)
    Parameters
    Type Name Description
    System.Boolean enableRtl
    Returns
    Type Description
    SwitchBuilder

    HtmlAttributes(Object)

    You can add the additional html attributes such as disabled, value etc., to the element. If you configured both property and equivalent html attribute then the component considers the property value.

    Declaration
    public SwitchBuilder HtmlAttributes(object htmlAttributes)
    Parameters
    Type Name Description
    System.Object htmlAttributes
    Returns
    Type Description
    SwitchBuilder

    Locale(String)

    Overrides the global culture and localization value for this component. Default global culture is 'en-US'.

    Declaration
    public SwitchBuilder Locale(string locale)
    Parameters
    Type Name Description
    System.String locale
    Returns
    Type Description
    SwitchBuilder

    Name(String)

    Defines name attribute for the Switch. It is used to reference form data (Switch value) after a form is submitted.

    Declaration
    public SwitchBuilder Name(string name)
    Parameters
    Type Name Description
    System.String name
    Returns
    Type Description
    SwitchBuilder

    OffLabel(String)

    Specifies a text that indicates the Switch is in unchecked state.

    Declaration
    public SwitchBuilder OffLabel(string offLabel)
    Parameters
    Type Name Description
    System.String offLabel
    Returns
    Type Description
    SwitchBuilder

    OnLabel(String)

    Specifies a text that indicates the Switch is in checked state.

    Declaration
    public SwitchBuilder OnLabel(string onLabel)
    Parameters
    Type Name Description
    System.String onLabel
    Returns
    Type Description
    SwitchBuilder

    Render()

    Declaration
    public HtmlString Render()
    Returns
    Type Description
    System.Web.HtmlString

    Value(String)

    Defines value attribute for the Switch. It is a form data passed to the server when submitting the form.

    Declaration
    public SwitchBuilder Value(string value)
    Parameters
    Type Name Description
    System.String value
    Returns
    Type Description
    SwitchBuilder
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved