locked
How ListView works when ListViewItem Template is null? RRS feed

  • Question

  • Hi.

    I want to know ListView handle binding data when ListViewItem Template is null (as default).

    I think if I bind UserControl list or any UI element list to ListView, ListView shows bound data as it is. And if ListViewItem template is exists, ListView shows bound data as template style. Is this right?

    Thursday, October 24, 2013 1:04 PM

Answers

All replies

  • What happens when you try it?

    If you don't provide a template you'll get the default one which will call ToString on the bound object.

    --Rob

    Thursday, October 24, 2013 3:10 PM
    Moderator
  • When I tried to bind my own UserControl collection without template, my UserControl has shown.

    Is this true that there is only bound items which has template or not? Is there any method to show both bounded items with template and custom ListViewItem sametime? (for example, insert AD control into between bounded ListViewItems)

    Thursday, October 24, 2013 4:53 PM
  • I don't understand what you're doing here. One typically binds data which then gets displayed in a template (which may include a UserControl). One doesn't bind controls themselves.

    Can you please provide a code snippet or (better) upload to SkyDrive a minimal repro project that demonstrates what you are doing.

    --Rob

    Monday, October 28, 2013 8:38 PM
    Moderator