@{
Dictionary<string, object> htmlAttribute = new Dictionary<string, object>()
{
{ "style", "margin: 15px; grid-start-column: 1" } ,
{"class", "customClass" }
};
}
<div id="ControlRegion">
<div class="col-lg-12 control-section">
<div class="control_wrapper">
<EjsDropDownList TItem="GameFields" HtmlAttributes="@htmlAttribute" TValue="string" PopupHeight="230px" Index=2 Placeholder="Select a game" DataSource="@Games">
<DropDownListFieldSettings Text="Text" Value="ID"></DropDownListFieldSettings>
</EjsDropDownList>
</div>
</div>
</div> |
<EjsDropDownList TItem="GameFields" CssClass="customStyle" TValue="string" PopupHeight="230px" Index=2 Placeholder="Select a game" DataSource="@Games">
<DropDownListFieldSettings Text="Text" Value="ID"></DropDownListFieldSettings>
</EjsDropDownList>
<style>
.customStyle {
width: 350px;
margin: 0 auto;
padding-top: 70px;
}
</style> |
<SfDropDownList TValue="string" TItem="GameFields" PopupHeight="230px" Width="200" HtmlAttributes="@htmlAttribute" Placeholder="Supervisor" @bind-Value="@DropVal" DataSource="@Games">
<DropDownListFieldSettings Value="text"></DropDownListFieldSettings>
</SfDropDownList>
@code{
public string DropVal { get; set; }
public class GameFields
{
public string id { get; set; }
public string text { get; set; }
}
Dictionary<string, object> htmlAttribute = new Dictionary<string, object>()
{
{"class", "e-manager" },
{"name", "manager" },
{ "style", "background-color: bisque; text-align: right" },
{"title", "Syncfusion DropDownList" }
};
List<GameFields> Games = new List<GameFields>() {
new GameFields(){ id= "Game1", text= "American Football" },
new GameFields(){ id= "Game2", text= "Badminton" },
new GameFields(){ id= "Game3", text= "Basketball" },
new GameFields(){ id= "Game4", text= "Cricket" },
new GameFields(){ id= "Game5", text= "Football" },
new GameFields(){ id= "Game6", text= "Golf" },
new GameFields(){ id= "Game7", text= "Hockey" },
new GameFields(){ id= "Game8", text= "Rugby"},
new GameFields(){ id= "Game9", text= "Snooker" },
new GameFields(){ id= "Game10", text= "Tennis"}
};
} |
|