Binding a List of String to ListBox without ItemTemplate

In one of my previous post , i explained about the the Databinding the ListBox in Windows Phone 7 that included the Item Template .

How do you bind just the List of String to a ListBox without any ItemTempalates ?

Very simple , just create the List of string and assign it to the ItemSource Property of the ListBox similar to the previous blog post .

private void FillListBox()
{
List Lst = new List();
Lst.Add("Senthil Kumar");
Lst.Add("Windows Phone");
Lst.Add("Microsoft .NET");
listBox1.ItemsSource = Lst;
}

Here’s the XAML code of the ListBox

<ListBox Height="596" Name="listBox1" Width="380" >

<ListBox.ItemTemplate>

Leave A Reply

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

You May Also Like

In this post, you will learn about sync provider notifications in Windows 11 and how to disable or enable it...
In this tutorial, let’s learn how to enable or disable the startup sound in Windows 11. By default, when Windows...
The CameraCaptureTask allows the Windows Phone 7 App to launch the Camera Application . This will be useful when the...