HomeWindowsBinding a List of String to ListBox without ItemTemplate

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

You May Also Like

This blog post will guide you through several effective methods to troubleshoot and resolve the issue of Microsoft Edge not...
Windows 11 offers a range of audio enhancements that can enrich your listening experience. These enhancements include features like virtual...
Windows 11 brings a fresh and visually stunning design to your desktop, and one of the standout features is the...