Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
146638 | Aug 12,2019 11:33 AM UTC | Sep 17,2019 08:45 AM UTC | Blazor | 7 |
![]() |
Tags: Dropdown List |
<p>@Fields.FieldTypeId</p>
<EjsDropDownList Placeholder="select..." @bind-Value="@Fields.FieldTypeId" DataSource="@FieldTypes">
<DropDownListFieldSettings Text="Caption" Value="FieldTypeId"></DropDownListFieldSettings>
</EjsDropDownList>
@code
{
protected Field Fields { get; set; } = new Field();
public class Field
{
public int FieldTypeId { get; set; } = 2;
}
public class FieldType
{
public string Caption { get; set; }
public int FieldTypeId { get; set; }
}
public List<FieldType> FieldTypes { get; set; } = new List<FieldType>
{
new FieldType() { Caption = "Australia", FieldTypeId = 1 },
new FieldType() { Caption = "Bermuda", FieldTypeId = 2 },
new FieldType() { Caption = "Canada", FieldTypeId = 3 },
new FieldType() { Caption = "Cameroon", FieldTypeId = 4 }
};
} |
@using Syncfusion.EJ2.Blazor.DropDowns;
<div class="col-sm-7">
<EjsDropDownList @bind-Value="@salle" ID="IdSalleExamenSys" DataSource="@salleExamenList" Placeholder="Sélectionner la salle" CssClass="e-field">
<DropDownListFieldSettings Value="IdSalleExamenSys" Text="NomSalle"></DropDownListFieldSettings>
</EjsDropDownList>
</div>
@code{
public int salle { get; set; } = 2;
public TemplateArgs Model = new TemplateArgs();
public List<SalleExamenSys> salleExamenList = new List<SalleExamenSys>();
public class SalleExamenSys
{
public int IdSalleExamenSys { get; set; }
public string NomSalle { get; set; }
}
protected override void OnInitialized()
{
salleExamenList = new List<SalleExamenSys>()
{
new SalleExamenSys() { IdSalleExamenSys = 1, NomSalle="Salle1" },
new SalleExamenSys() { IdSalleExamenSys = 2, NomSalle="Salle2" }
};
}
} |
<div class="col-sm-7">
<EjsDropDownList TValue="int?" ID="IdSalleExamenSys11" Index=0 DataSource="@salleExamenList" Placeholder="Sélectionner la salle" CssClass="e-field">
<DropDownListFieldSettings Value="IdSalleExamenSys" Text="NomSalle"></DropDownListFieldSettings>
</EjsDropDownList>
</div>
|
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.