<SfDropDownList Placeholder="Select an item..." ShowClearButton="true" Width="100%" TValue="string" TItem="SilverBlazorComboBoxModel" @bind-Value="Value" DataSource="@ComboList" CssClass="@(!isValid? "invalid": "")"> <DropDownListEvents ValueChange="ComboBoxItemSelected" TValue="string"></DropDownListEvents> <DropDownListFieldSettings Value="ComboValue" Text="ComboText"></DropDownListFieldSettings> </SfDropDownList>
async Task ComboBoxItemSelected(Syncfusion.Blazor.DropDowns.ChangeEventArgs<string> args) { if (args != null) { //Do Work... } }
|
<SfDropDownList Placeholder="Select an item..." ShowClearButton="true" Width="100%" TValue="string" TItem="SilverBlazorComboBoxModel" @bind-Value="Value" DataSource="@ComboList">
<DropDownListEvents ValueChange="ComboBoxItemSelected" TItem="SilverBlazorComboBoxModel" TValue="string"></DropDownListEvents>
<DropDownListFieldSettings Value="ComboValue" Text="ComboText"></DropDownListFieldSettings>
</SfDropDownList>
@code{
async Task ComboBoxItemSelected(Syncfusion.Blazor.DropDowns.ChangeEventArgs<string, SilverBlazorComboBoxModel> args)
{
//if (args != null)
//{
// //Do Work...
//}
}
} |