@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}
};
} |