Nov 07

The new ListView control has two properties that you might confuse when you start using the control. As you may have guessed by this post, they have different purposes (but they”re both templates).

The EmptyDataItem lets you set the aspect of the control when its DataSource property is null ,,)ie, the control will render that template when it has no items to show).

The EmptyItemTemplate is used only when you”re using grouping. When you do that, your control will output something like this:

A | B | C
D |E | F


In the previous schema, each group has at most 3 elements: each line represents a group and each letter represents an item that the control is showing. Now suppose that in the previous example you only have 5 elements:

A | B | C
D |E | XXX

If you specify a template for the EmptyItemTemplate property, then the control will render the XXX item with the contents you specify in that template.

2 comments so far

  1. nauman
    6:20 am - 1-20-2010


  2. Nauman Ahmed
    6:21 am - 1-20-2010


Leave a Reply


