Telerik RadControls for Windows Phone – Article #6 – RadAutoCompleteBox

RadAutoCompleteBox is a Autocomplete textbox that is part of the RadControls for Windows Phone . The RadAutoCompleteBox provides a textbox along with additional functionality of providing the suggestion based on the characters the user types in the textbox .

To add the RadAutoCompleteBox to your Windows Phone App , you need to include the following dll’s to your project

  • Telerik.Windows.Core.dll
  • Telerik.Windows.Controls.Input.dll

To add the RadAutoCompleteBox to your Windows Phone Page , you can add the following XAML code to your Windows Phone page

<telerikInput:RadAutoCompleteBox Height="79" Name="radAutoCompleteBox1" Text="TextBox" Width="414" />

If you want to add the RadAutoCompleteBox via Code behind , you can create and instance of RadAutoCompleteBox like the one below

RadAutoCompleteBox radAutoCompleteBox1 = new RadAutoCompleteBox();

You should also add the following namespace in your codebehind file

using Telerik.Windows.Controls;

Now comes the important aspect of the RadAutoCompleteBox – Providing Suggestion .

Once you have added the RadAutoCompleteBox to the Windows Phone Page , you need to set the SuggestionsSource property so that the related suggestions are displayed when the user enters the characters in the textbox .

private ListGetSuggestions()
{
   List MobilePhoneModel = new List();
   MobilePhoneModel.Add("HTC Mozart");
   MobilePhoneModel.Add("HTC HD7");
   MobilePhoneModel.Add("Nokia Lumia 800");
   MobilePhoneModel.Add("Nokia Lumia 710");
   MobilePhoneModel.Add("Nokia Lumia");
   return MobilePhoneModel;
}

radAutoCompleteBox1.SuggestionsSource = GetSuggestions();
Telerik RadControls for Windows Phone – Article #6 – RadAutoCompleteBox - 1
Telerik RadControls for Windows Phone – Article #6 – RadAutoCompleteBox – 1

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

In this post, you’ll learn about the Win32 Error “0x000019E5 – ERROR_COULD_NOT_RESIZE_LOG” that you get when debugging system erors in...
In this post, you’ll learn about the error “CO_E_DBERROR 0x8004E02B” that is returned when working with COM based APIs or...
In this post, you’ll learn about the Win32 Error “0x000019D0 – ERROR_LOG_BLOCK_VERSION” that you get when debugging system erors in...