ListView doesn't display data

I want to display a table with the items from an ObservableCollection of Type Vendor that exists. The problem is that when I load the data in the collection it doesn't display it. Here is my xaml code (i'm sure i'm missing something):

<Grid x:Name="Grid1">
    <ListView Name="ListViewVendors" 
              Margin="4,20,40,100" 
              ItemsSource="{Binding Path=VendorsCollection}">
        <ListView.Background>
            <LinearGradientBrush>
                <GradientStop Color="Gray" Offset="0"/>
            </LinearGradientBrush>
        </ListView.Background>
        <ListView.View>
            <GridView>
                <GridViewColumn Header="Vendor Name" 
                                DisplayMemberBinding="{Binding Path=Name}"/>
                <GridViewColumn Header="Contact Name" 
                                DisplayMemberBinding="{Binding Path=ContactName}"/>
                <GridViewColumn Header="Contact Phone" 
                                DisplayMemberBinding="{Binding Path=ContactPhone}"/>
                <GridViewColumn Header="Contact Fax" 
                                DisplayMemberBinding="{Binding Path=ContactFax}"/>
                <GridViewColumn Header="Contact Email" 
                                DisplayMemberBinding="{Binding Path=ContactEmail}"/>
                <GridViewColumn Header="Contact Website" 
                                DisplayMemberBinding="{Binding Path=ContactWebSite}"/>
            </GridView>
        </ListView.View>
    </ListView>
</Grid>

Answers


You might be missing a DataContext for the ItemsSource binding; either way might want to learn how to debug bindings so you can give us the binding errors you get.

Or perhaps you can even solve the problem yourself as those are usually very helpful.


Need Your Help

PHP avoiding a long POST

php html post

This is more of a technique question rather than maybe code. I am having a php form with many fields (items to select). Naturally some of the items might be selected and some not. How do I know which

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.