More in this section
Forums / Module Builder / How to use RadListView datagrouping in Widget Templates?

How to use RadListView datagrouping in Widget Templates?

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
    LUDWIG avatar
    7 posts
    06 Jul 2012
    10 Mar 2015
    Link to this post


    I have made a dynamic module which is used to import from a Sharepoint document library.

    Then I tried to change the generated widgets in Design->Widget Templates to implement datagrouping in the RadListView. I wanted to group by a field named 'DocumentationCategory'

    The problem is that Sitefinity then tells me that the GroupField does not exist in the DynamicContent:

    No property or field 'DocumentationCategory' exists in type 'DynamicContent'

    Here is my code:

    <telerik:RadListView ID="dynamicContentListView" ItemPlaceholderID="DataGroupPlaceHolder3" runat="server" EnableEmbeddedSkins="false" EnableEmbeddedBaseStylesheet="false"
          <telerik:ListViewDataGroup GroupField="DocumentationCategory" DataGroupPlaceholderID="DataGroupPlaceHolder2"
                  <div class="sfContentBlock">
                      <asp:PlaceHolder ID="ItemsContainer" runat="server" />
          <asp:PlaceHolder ID="DataGroupPlaceHolder2" runat="server"></asp:PlaceHolder>
              <sf:SitefinityLabel runat="server" Text='<%# Eval("Shorttitle")%>' WrapperTagName="div" HideIfNoText="true" CssClass="sfitemShortTxt" data-sf-field="Shorttitle" data-sf-ftype="ShortText"/>
                <sf:AssetsField runat="server" DataFieldName="FileLeafRef" />

    What is wrong?

    Thanks in advance.

  2. Nikola Zagorchev
    Nikola Zagorchev avatar
    424 posts
    19 Apr 2017
    13 Mar 2015
    Link to this post
    Hello Ludwig,

    The problem is that the lit view tries to find that field in the DynamicContent type. However, this field is 'dynamic' and is not part of the DynamicContent class, which throws the exception. You can either group the datasource and rebind after that, or bind the listview of a model class that 'translates' the dynamic content default and custom properties to that model class. The model class will have default field DocumentationCategory.

    Nikola Zagorchev
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
2 posts, 0 answered