Class SwitchBuilder
Inheritance
System.Object
SwitchBuilder
Assembly: Syncfusion.EJ2.dll
public class SwitchBuilder : ControlBuilder
Constructors
Declaration
Declaration
public SwitchBuilder(Switch model)
Parameters
Type |
Name |
Description |
Switch |
model |
|
Fields
Declaration
Field Value
Properties
Declaration
public IDictionary<string, object> HtmlAttr { get; set; }
Property Value
Type |
Description |
System.Collections.Generic.IDictionary<System.String, System.Object> |
|
Declaration
public string ID { get; set; }
Property Value
Type |
Description |
System.String |
|
Declaration
public override TextWriter Output { get; set; }
Property Value
Type |
Description |
System.IO.TextWriter |
|
Overrides
Methods
Triggers when Switch state has been changed by user interaction.
Declaration
public SwitchBuilder Change(string change)
Parameters
Type |
Name |
Description |
System.String |
change |
|
Returns
Declaration
public SwitchBuilder Checked(bool check = true)
Parameters
Type |
Name |
Description |
System.Boolean |
check |
|
Returns
Triggers once the component rendering is completed.
Declaration
public SwitchBuilder Created(string created)
Parameters
Type |
Name |
Description |
System.String |
created |
|
Returns
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
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
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
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
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
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
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
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
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
Declaration
public HtmlString Render()
Returns
Type |
Description |
Microsoft.AspNetCore.Html.HtmlString |
|
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