Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
146892 | Aug 23,2019 07:51 PM UTC | Sep 23,2019 07:28 AM UTC | Blazor | 8 |
![]() |
Tags: TextBox |
@using Syncfusion.EJ2.Blazor.Inputs
<h3>SyncInput</h3>
<EjsTextBox @bind-Value="@Name"></EjsTextBox>
<p>Value: @Name</p>
@code {
public string Name { get; set; } = "Testing";
} |
@using Syncfusion.EJ2.Blazor.Inputs;
@using Syncfusion.EJ2.Blazor.DropDowns;
<h5>TextBox</h5>
<EjsTextBox @bind-Value="@Name"></EjsTextBox>
<p>Value: @Name</p>
<h5>DropDownList</h5>
<EjsDropDownList ID="programSelect" CssClass="form-control" Placeholder="Type" DataSource="@PhoneTypeList" @bind-Value="@PhoneTypeID">
<DropDownListEvents TValue="int" ValueChange="@UpdatePhoneType"></DropDownListEvents>
<DropDownListFieldSettings Value="Key" Text="Value"></DropDownListFieldSettings>
</EjsDropDownList>
<p>Two-Bind Value: @PhoneTypeID</p>
<p>Selected Value: @selectedValue</p>
@code {
public string Name { get; set; } = "Testing";
public int PhoneTypeID { get; set; } = 987;
public int? selectedValue { get; set; }
public void UpdatePhoneType(ChangeEventArgs<int> args)
{
selectedValue = args.Value;
}
public class PhoneType
{
public string Value { get; set; }
public int Key { get; set; }
}
List<PhoneType> PhoneTypeList = new List<PhoneType>()
{
new PhoneType() {Value="Iphone", Key = 456},
new PhoneType() {Value="Samsung", Key = 987}
};
} |
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.