Share via

Web Forms Combobox default value

Luna 1 Reputation point
2021-12-17T09:10:16.603+00:00

Hi

How I can show as selected value in combobox, object that is not on combobox list?
I have object list:

Id
Name 
Active

and combobox should show only active object on list but can also show as selected item with Active:false at first (like default value from another object)

I have something like this:

   <Combobox ItemSource="Binding Source={StaticResource List}}" DisplayMemberPath="Id" SelectedValue="{Binding Id}">
Developer technologies | ASP.NET Core | Other

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.