填充RadAutoCompleteBox

时间:2014-02-24 16:10:22

标签: c# telerik windows-phone

如何填充RadAutoСompleteBox

<telerik:RadAutoCompleteBox HorizontalAlignment="Left" verticalAlignment="Top">
        <Dropdownitems> 
             <item text = 1>
             <item text = 2>
        </DropDownitems>
</telerik:RadAutoCompleteBox>

dropdownitems毫无意义,我只是想描绘我想做的事情。

1 个答案:

答案 0 :(得分:1)

<强>的Xaml:

    <telerikInput:RadAutoCompleteBox x:Name="AutoCompleteBox"
                                     VerticalAlignment="Top" />

<强> CS:

    var suggestions = new List<string>();
    for (var i = 0; i < 10; i++)
        suggestions.Add("suggestion" + i);

    AutoCompleteBox.SuggestionsSource = suggestions;

有关RadAutoCompleteBox

的有用信息

我希望它有所帮助!