Drop Down of Objects

Dropdown (Single)

This example makes use of a fixed list of OptionData which has a single property called Name. These are filtered within the OnLoad callback.

Item Comparer

When dealing with objects it is a good practice to set the RfDropDown.ItemComparer parameter. The RfDropDown uses this to determine if an item within RfDropDown.Items is selected. By default the ItemComparer is set to:

(i1, i2) => i1?.Equals(i2)

The only time the ItemComparer does not have to be set with an object is when the list of options stays the same. That would then allow the equals reference check to come back as true.

This still works because the value of SelectedItem and AllOptions are never changing and the compareison is a reference comparison.

An unhandled error has occurred. Reload 🗙