In WPF can i display empty rows in listview without binding to anything?
Is it possible to show specified number of rows in the listview. This is because my whole listview area looks empty, but after va开发者_如何转开发lues are binded it is ok. So is it possible to show rows before binding.
Thanks,
In the XAML you could do something like this:
<ListView name="myListView">
<ListViewItem>test1</ListViewItem>
<ListViewItem>test2</ListViewItem>
</ListView>
That would populate some test items in the list view to be displayed. You would need to clear the listview's items collection before you bound to it though or you'll get an exception:
myListView.Items.Clear()
See if you can use the AddChild method or just use myListView.Items.Add(new ListViewItem())
.
Just an educated guess, I can't try this out right now.
精彩评论