+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Download List Control Always Displaying All Column Titles

Download List Control Always Displaying All Column Titles

3 posts, 0 answered
  1. Christine Coder
    Christine Coder avatar
    1 posts
    Registered:
    01 Apr 2010
    30 Jun 2010
    Link to this post
    Hello there,

    We're recreating a SharePoint site using Sitefinity and we just added our first Download List control.  The settings don't seem to be applying correctly.  We can uncheck some columns, but their headers still show up in the display.  Can't imagine this is the desired behavior.  There must be a way to allow administrative users to include or exclude columns using the administration console, but I can't seem figure it out.  Please let me know what I am missing.  Thank you.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    30 Jun 2010
    Link to this post
    Hi Christine Coder,

    The easiest way to fix this is mapping the external template

    [Sitefinity_3_7_standard_ExternalTemplates]\Sitefinity\Admin\ControlTemplates\Libraries\Modes\DownloadListTableMode.ascx and remove the tr elements from the table. You could map the external template from ItemListTemplatePath property that is located under TemplatePaths category of the Advanced tab.

    <HeaderTemplate>
           <table class="sf_libraryGrid">
               <thead>
               <tr>
                   <th scope="col" id="TitleWrap" runat="server"><asp:Literal ID="Literal1" runat="server" Text="<%$Resources:Items_Title %>"></asp:Literal></th>
                   <th scope="col" id="ExtWrap" runat="server"><asp:Literal ID="Literal2" runat="server" Text="<%$Resources:Items_Extension %>"></asp:Literal></th>
                   <th scope="col" id="AuthorWrap" runat="server"><asp:Literal ID="Literal3" runat="server" Text="<%$Resources:Items_Author %>"></asp:Literal></th>
                   <th scope="col" id="UploadDateWrap" runat="server"><asp:Literal ID="Literal4" runat="server" Text="<%$Resources:Items_UploadDate %>"></asp:Literal></th>
                   <th scope="col" id="SizeWrap" runat="server"><asp:Literal ID="Literal5" runat="server" Text="<%$Resources:Items_Size %>"></asp:Literal></th>
                   <th scope="col" id="TagWrap" runat="server"><asp:Literal ID="Literal6" runat="server" Text="<%$Resources:Items_Tags %>"></asp:Literal></th>
                   <th scope="col" id="DownloadLinkWrap" runat="server"></th>
               </tr>
               </thead>
               <tbody>
       </HeaderTemplate>
       <ItemTemplate>
        ...



    Kind regards,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Michael Waddell
    Michael Waddell avatar
    5 posts
    Registered:
    12 Jan 2005
    30 Jun 2011
    Link to this post
    My "short and sweet" solution that is suitable for savvy non-programmers is to add this JavaScript in a Generic Content Block control at the bottom of your page (or include it as an external script).

    <script type="text/javascript">
    /* HIDE THE AUTHOR and TAGS columns */
    /* DO NOT EDIT THIS IN DESIGN MODE, use HTML mode */
        var myColHeads = document.getElementsByTagName('th');

        for(i=0; i < myColHeads.length; i++) {
            var col = myColHeads[i];
            if (col.innerHTML=='Author') {
                col.style.display="none";
            }
            if (col.innerHTML=='Tags') {
                col.style.display="none";
            }
        }

        var myTDs = document.getElementsByTagName('td');
        for(i=0; i < myTDs.length; i++) {
            var td_id = myTDs[i].id;
            if (td_id.indexOf('_AuthorWrap') != -1) {
                myTDs[i].style.display="none";
            }
            if (td_id.indexOf('_TagWrap') != -1) {
                myTDs[i].style.display="none";
            }
        }

     </script>
Register for webinar
3 posts, 0 answered