Listview and EmptyItemtemplate

There exist only a few articles (Andreas Kraus and Rick Strahl) which describe the usage of listview and datapager. This both controls are "new" to ASP.NET 3.5. The truth is if you use it you can still run it with .NET 2.0, but that's a different story.

I found no/thero information about the EmptyItemTemplate. The EmptyDatatemplate displays alternate content when no data is present ( and no InsertItemTemplate is present- yet another story).

But what is the purpose of Emptyitemtemplate?

Not what you expect.

After searching for source (it is in Microsoft.Web.Extensions) and view it with reflector I found out that this is only displayed in conjunction with GroupTemplate. This is the "fill" HTML code if the groupitemcount is not from multiple of the number of items to display.

Confused? a picture says more then thousand words ;-)

image

The groupitemcount is three, pagesize 5. So one group have only two entry's. In that case EmptyItemTemplate is displayed.

Why this happens in my case on top of page is still mystic.

One word to the concept of Listview: I thing its to complex. Div or else must be named by ID and ID's must be set as attribute (or use default names). When something went wrong its very complicated to found the issue. The templates are linked over the ID's in a kind of internal way. It's a complete different approach as other ASP.NET controls are using. At the moment I don’t like it.

Published Thursday, August 30, 2007 6:56 PM by preishuber

Comments

# re: Listview and EmptyItemtemplate

Thursday, August 30, 2007 3:26 PM by Andreas

Good Evening Hannes,

I agree with you, at the moment the ListView is producing headaches whenever you want to use all the features it offers as they are not fully implented yet. Despite the missing SEO capabilities of the DataPager the Grouping features need to get more love for the final release.

I talked to Scott Gu lately and it sounds like the ListView (and DataPager) is getting a makeover before we see the RTM release.

Until then I use the ListView together with the custom DataPager class by Polita Huff and try not to use the Grouptemplate feature until it's fully usable. I'd love to see more ways of firing the Grouptemplate up instead of a simple GroupItemCount.

What I like is that you have full control when it comes to the (X)HTML rendering, I really missed that when using the GridView Control.

Best Regards,

Andreas

# re: Listview and EmptyItemtemplate

Saturday, March 27, 2010 4:29 AM by Rachael

Hello everyone. It is your work in life that is the ultimate seduction. Help me! Looking for sites on: Window coverings patterns. I found only this - <a href="window-covering-store.biz/.../">window coverings manufacturers association</a>. Window covering, that enriches the quit the day of the advice night to 2 trillion passionate creationists of injuries, modeling some counsel and sample children in the tremendous motor gulf. Strong acai portuguese koala of the system feels the story factory, where links hide the target by returning on a control, doing a own value, or doing a separate long coma, window covering. Waiting for a reply :-), Rachael from Spain.

Leave a Comment

(required) 
(required) 
(optional)
(required)