In WPF, can empty lines be displayed in listview without being tied to anything?

Is it possible to specify the specified number of lines in the list. This is because my entire viewport looks empty, but after binding the values, this is normal. So you can show the lines before binding.

Thanks,

+3
source share
2 answers

In XAML, you can do something like this:

<ListView name="myListView">
    <ListViewItem>test1</ListViewItem>
    <ListViewItem>test2</ListViewItem>
</ListView>

This will populate some test items in the displayed list. You will need to clear the collection of list items before you attach to it, or you will get an exception:

myListView.Items.Clear()
+1
source

, AddChild myListView.Items.Add(new ListViewItem()).

, .

0

Source: https://habr.com/ru/post/1723851/


All Articles