开发者

add button in each row I create in WPF listview

开发者 https://www.devze.com 2023-01-28 17:53 出处:网络
how can I create button in each row I add in listview in c# WPF Like what when you conn开发者_高级运维ect to wireless network in windows 7 ?You need to assign the ListView a DataTemplate for it\'s ite

how can I create button in each row I add in listview in c# WPF Like what when you conn开发者_高级运维ect to wireless network in windows 7 ?


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>
0

精彩评论

暂无评论...
验证码 换一张
取 消