Mobile Zone is brought to you in partnership with:

Senthil Kumar is a Software Engineer who has around 3 years of experience in IT industry. He is currently working as a Software Engineer in Bangalore and works mainly on the Windows or Client Development technologies and has good working experience in C#/.NET, Delphi, Winforms and SQL Server. He is also a Microsoft Technology Certified Professional in ASP.NET. He Blogs at http://www.ginktage.com and http://www.windowsphonerocks.com. He enjoys learning as much as he can about all things related to technologies to get a well-rounded exposure of technologies that surround him. Senthil completed his Master of Computer Applications from Christ College (Autonomous), Bangalore in the year 2009 and is a MCA Rank Holder. He has passion for Microsoft technologies especially Windows Phone development. You can connect with him on Twitter at (http://twitter.com/isenthil) , on Facebook at (http://www.facebook.com/kumarbsenthil) and his blog (www.ginktage.com). Senthil is a DZone MVB and is not an employee of DZone and has posted 129 posts at DZone. You can read more from them at their website. View Full User Profile

RadAutoCompleteBox with Telerik RadControls for Windows Phone

04.05.2012
| 3559 views |
  • submit to reddit

RadAutoCompleteBox is an Autocomplete textbox that is part of the RadControls for Windows Phone. The RadAutoCompleteBox provides a textbox along with the 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 Suggestions.

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();

 

Published at DZone with permission of Senthil Kumar, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)