How to use RadListView datagrouping in Widget Templates? - Front- & Back-End Development - Front- & Back-End Development - Progress Community
 Front- & Back-End Development

How to use RadListView datagrouping in Widget Templates?

  • How to use RadListView datagrouping in Widget Templates?
  • Hi,

    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.

  • 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