-
Notifications
You must be signed in to change notification settings - Fork 7
Dropdowns
Nathan Smith edited this page Nov 15, 2025
·
1 revision
Use this cheat sheet when adding Syncfusion SfDropDownList or Fluent Combobox components in the .NET 9 Blazor app.
@using Syncfusion.Blazor
@using Syncfusion.Blazor.DropDownsAdd page-specific namespaces only when needed.
<SfDropDownList TItem="string" TValue="string"
DataSource="@Names"
@bind-Value="SelectedName"
Placeholder="Select">
</SfDropDownList>-
DataSourcemust be non-null (Array.Empty<string>()if you have no data yet) -
Placeholderkeeps Fluent styling aligned
<SfDropDownList TItem="CarrierLookup" TValue="int?"
DataSource="@Carriers"
@bind-Value="SelectedCarrierId"
AllowFiltering="true"
@bind-Value:after="OnCarrierChanged">
<DropDownListFieldSettings Text="Name" Value="CarrierId" />
<DropDownListEvents TValue="int?" TItem="CarrierLookup"
ValueChange="OnCarrierChanged" />
</SfDropDownList>- Always supply
DropDownListFieldSettingswhenTItemis not a simple type - When using
AllowFiltering, provide eitherFilterTypeor aFiltercallback—not both
<DropDownListTemplates TItem="CarrierLookup">
<HeaderTemplate>
<div class="carrier-header">
<span>Carrier</span>
<span>Type</span>
</div>
</HeaderTemplate>
<ItemTemplate>
<div class="carrier-item">
<span>@context.Name</span>
<span class="badge">@context.Type</span>
</div>
</ItemTemplate>
</DropDownListTemplates>Remember: @context is typed as TItem.
<FluentCombobox @bind-Value="SelectedProduct"
Items="@ProductOptions"
ValueField="Value"
TextField="Label"
OnChange="OnProductChanged" />Use Fluent Combobox for shorter lists when you want native Fluent styling.
- Wrap dropdowns inside
<EditForm>and useValidationMessage For="() => Model.Property" - For Syncfusion components embedded in forms, set
ValueExpression="() => Model.Property"
- Inventing attributes (
TItemType,PlaceholderText,FieldSettings) – they do not exist - Putting
ValueChangeon the root tag instead of in<DropDownListEvents> - Self-closing
<SfDropDownList />tags (rare, but avoid to keep markup consistent)
-
Domain/Accounting/Components/SettlementScreen.razor– advanced dropdown + validation combos -
Domain/Clients/Components/BusinessDetailsEditor.razor– filtering + custom templates for contact roles
Copy from these examples to keep generated code consistent.
Quickfire Wiki • Generated from Qf-Docs/wiki • Last updated: 2025-11-14.
See the main repo for README + issues.
- Home
- Getting Started
- System Architecture
- Release Notes
- Features
- Agents & AI
- Reference
- Guides
- Integrations
- Archive