Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 1.03 KB

readme.md

File metadata and controls

29 lines (21 loc) · 1.03 KB

TypeAhead

Provides a wrapper over the popular typeahead.js library.

Sample 1: Binding to a collection of strings

You can bind the control to a collection of strings:

<dc:TypeAhead DataSource="{value: CountryNames}" 
              SelectedValue="{value: SelectedCountryName}" />
<br />
Selected Value: <span class="result">{{value: SelectedCountryName}}</span>

Sample 2: Binding to a collection of objects

You can bind the control to a collection of any objects and use the DisplayMember and ValueMember properties to specify, which fields should be used as the item text and item value. This approach is similar to the ComboBox control.

<dc:TypeAhead DataSource="{value: Countries}" 
              SelectedValue="{value: SelectedCountryId}" 
              DisplayMember="Name" 
              ValueMember="Id" />
<br />
Selected object ID: <span class="result">{{value: SelectedCountryId}}</span>