Working with the System.Web.UI.WebControls.ListView in Sitecore

The new System.Web.UI.WebControls.ListView control is one of the new templated controls thats available in the Windows Presentation Foundation. But the control is not available for users in Sitecore. First you must add the control to the web.config in the typesThatShouldNotBeExpanded section (yes, that’s really it’s name):


Now you can use the ListView control. The control is really cool since it allows you to do stuff without much code. This is an example of presenting the XML from a Google Search Appliance result. I won’t give you the codebehind, but I can tell you that all you have to do is that on Page_Load i feed the XML from the GSA request directly to the XmlDataSource. And that’s it:

<asp:XmlDataSource ID="xmlDataSource" EnableCaching="false" EnableViewState="false" runat="server" XPath="GSP/RES/R" >

<asp:ListView DataSourceID="xmlDataSource" EnableViewState="false" id="SearchResultListView" runat="server">
        <asp:PlaceHolder runat="server" id="itemPlaceHolder" />
        <a href="<%# XPath("U") %>">
          <%# XPath("T") %>
        <%# XPath("S") %>
        <a href="<%# XPath("U") %>">
          <%# XPath("U") %>
          ... no match found ...

About briancaos

Developer at Pentia A/S since 2003. Have developed Web Applications using Sitecore Since Sitecore 4.1.
This entry was posted in .net, c#, Sitecore 6 and tagged , , , , , . Bookmark the permalink.

1 Response to Working with the System.Web.UI.WebControls.ListView in Sitecore

  1. sluersen says:

    Hi Brian,

    Great article! Thanks for writing this. I just wanted to comment that working with ListView is a covered in Sitecore CMS 6.2 training for developers.

    For those who are interested in learning how to develop with Sitecore CMS 6.1 and greater, please see


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.