kartal
kartal

Reputation: 18096

add button in each row I create in WPF listview

how can I create button in each row I add in listview in c# WPF Like what when you connect to wireless network in windows 7 ?

Upvotes: 1

Views: 2726

Answers (1)

Greg Sansom
Greg Sansom

Reputation: 20870

You need to assign the ListView a DataTemplate for it's items. Try this:

<ListView ItemsSource="{Binding Path=MyCollection}">
    <ListView.ItemTemplate>
        <DataTemplate >
            <Button>Go</Button>
        </DataTemplate>
    </ListView.ItemTemplate>
</ListView>

Upvotes: 2

Related Questions