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

Forums / Bugs & Issues / List items, position order doesn’t work

List items, position order doesn’t work

14 posts, 0 answered
  1. Mat
    Mat avatar
    23 posts
    Registered:
    05 Nov 2006
    08 Jun 2007
    Link to this post
    Hi,

    We created a few lists in the module section and moved some items in it, reorder the positions. It works fine in the module section but in the actual page the items are displayed always in order of entering the items (Last items are always first in the list).

    Is it a bug? Or did I do something wrong?

    Greetings,
    Mat
  2. Vassil Daskalov
    Vassil Daskalov avatar
    261 posts
    Registered:
    18 May 2013
    08 Jun 2007
    Link to this post
    Hello Mat,

    It seems there is a problem with the DisplayList control for which we apologize. It will be fixed for the service pack. The problem occurs due to the fact that the Items property does not return ordered collection. Thank you very much for reporting this issue. We have updated your Telerik account.

    For quick workaround I would suggest that you create a user control though it will need some more extra hours to implement. You should  use the GetListItems() method from the ListManager.

    Best wishes,
    Vassil Daskalov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Arlen Frew
    Arlen Frew avatar
    4 posts
    Registered:
    17 May 2005
    08 Jun 2007
    Link to this post
    We were just going to report this bug as well - can you provide a little more detail on the work around? 

    None of our lists are useable with the random order and we would like to get this site live in the next few days.

    Thanks.
  4. Pepi
    Pepi avatar
    981 posts
    Registered:
    08 Dec 2016
    11 Jun 2007
    Link to this post
    Hello Mat,

    This bug has already been fixed and the fix will be available in the Service Pack which is scheduled for the second half of June.
    As for the workaround, please have a look at the attachment.
    Hope this will help you.

    Regards,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  5. bnye
    bnye avatar
    332 posts
    Registered:
    22 Sep 2005
    13 Jun 2007
    Link to this post
    I tried this with an Anchored List (2 repeaters) and nothing appears. Can you point me in the right direction?

    Sincerely,

    Ben
  6. Pepi
    Pepi avatar
    981 posts
    Registered:
    08 Dec 2016
    14 Jun 2007
    Link to this post
    Hello bnye,

    Are you calling this method in your repeater:

    <%# DataBinder.Eval(Container.DataItem, "Price") %>

    It evaluates the data-binding expressions at run time.

    Have a look at the attached example in the previous post. It contains a working example. Maybe it will help you do solve your problem.

    Let us know if you need any further assistance.

    Sincerely yours,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  7. bnye
    bnye avatar
    332 posts
    Registered:
    22 Sep 2005
    14 Jun 2007
    Link to this post
    Hmmm. I tried a real quick example and was not able to get it to show.

    id="top" href="#"></a> 
    <asp:Repeater ID="listsLinks" runat="server"
        <ItemTemplate> 
             
            <ul class="alightenListLinksUl"
                <asp:Repeater ID="listItemsLinks" runat="server"
                    <ItemTemplate> 
                        <li> 
                            <id="linkItem" href="#<% Eval("Headline"); %>"></a> 
                        </li> 
                    </ItemTemplate> 
                </asp:Repeater> 
            </ul> 
        </ItemTemplate> 
    </asp:Repeater> 
     
     
    <asp:Repeater ID="lists" runat="server"
        <ItemTemplate>         
            <div class="alightenListItemsWrapper"
                <asp:Repeater ID="listItems" runat="server"
                    <ItemTemplate> 
                       <div class="alightenListItemHeader"
                            <id="#<% Eval("Headline"); %>"></a>                         
                            "<% Eval("Headline"); %>"                 
                       </div> 
                       <div class="aligtenListItemContent">  
                            "<% Eval("Content"); %>
                       </div> 
                       <div class="alightenListItemBackTopWrapper">  
                           <href="#top" id="backToTop" title="Back to the top of the page" class="alightenListItemBackTop">Back to top</a> 
                       </div> 
                    </ItemTemplate> 
                </asp:Repeater> 
            </div> 
        </ItemTemplate> 
    </asp:Repeater> 

    and then my codebehind is exactly like yours except with the extra repeater.
    private void RebindData() 
        { 
            if (listsIds != null
            { 
                ListManager manager = new ListManager(); 
                ArrayList list = new ArrayList(); 
                foreach (Guid id in listsIds) 
                {  
                    list.AddRange(manager.GetListItems(id)); 
                } 
                listsLinks.DataSource = list; 
                listsLinks.DataBind(); 
                lists.DataSource = list; 
                lists.DataBind(); 
            } 
             
        } 

    Can you let me know what a better workaround might be?
    When do you expect the service pack?

    Sincerely,

    Ben
  8. Pepi
    Pepi avatar
    981 posts
    Registered:
    08 Dec 2016
    15 Jun 2007
    Link to this post
    Hello bnye,

    Service Pack should be out by the end of next week, so you could wait for it if you are not pressed by time as this issue is already fixed.

    As for your implementation, you are using nested repeaters, but you are binding only the outer repeaters (listsLinks and lists). You should also access and bind inner repeaters in order to display some data. You could access the inner repeater in the method, handling the OnItemDataBound event of the outer repeater.

    Also, the syntax of the Eval method is wrong:

    "<% Eval("Content"); %>"

    should be

     <%# Eval("Content") %>


    <
    a id="#<% Eval("Headline"); %>"></a>

    should be

    <a id='#<%# Eval("Headline") %>'></a>

    You should have # after the opening server tag (<%) and you don’t need semi-colon before the closing one (%>). Also, you should alternate single quote (‘) with double quotes (“) in such kind of expressions.

    All data-binding expressions must be contained between <%# and %> characters:
    <%# data-binding expression %>

    Hope this information is useful and helpful for you.

    Kind regards,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  9. OC
    OC avatar
    129 posts
    Registered:
    17 Nov 2004
    04 Jul 2007
    Link to this post
    Hi. I'm having the same problem, and have installed SP1, but still the position order is not working. Not sure why this is, whether it's due to upgrading problems, or the bug is still present in the new release?

    Is there anything more I need to do than running the SP1 .exe installation file?

    OC 
  10. Pepi
    Pepi avatar
    981 posts
    Registered:
    08 Dec 2016
    04 Jul 2007
    Link to this post
    Hello Ole,

    The list order issue is already fixed and is available in SP1. Most probably you have an upgrading problem because it’s not enough to run the new .exe file. You should unistall the previous version first and make sure you delete the whole C:\Program Files\telerik\Sitefinity3.0 folder.
    You can find more information how to upgrade your project in User Manual, chapter “Upgrading Projects from Previous Sitefinity 3.0 Versions to Official Release Version”.

    Hope this will help you.

    All the best,
    Pepi
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  11. OC
    OC avatar
    129 posts
    Registered:
    17 Nov 2004
    04 Jul 2007
    Link to this post
    And this goes also when upgrading from the first 3.0 official release. All your documentation clearly states "Upgrading from pre-release versions".

    And do I need to re-create my current projects, or are they automatically updated?

    OC
  12. Rebecca
    Rebecca avatar
    536 posts
    Registered:
    24 Sep 2012
    04 Jul 2007
    Link to this post
    Hello,

    You are most probably looking at some older version of the User Manual: Here are the steps to follow to upgrade your project:

    1.Back up your old project and database by copying them to a different directory. Note that the C:\Program Files\telerik\Sitefinity3.0\WebSites folder will be deleted when you uninstall the old Sitefinity version.

    Before proceeding, we recommend that you compare your project’s web.config file to the C:\Program Files\telerik\Sitefinity3.0\ProjectManager\EmptyProject\web.config file. Note down the changes you have made, as you will need to add those to the new project’s web.config.

    2. Uninstall the old version. Make sure the C:\Program Files\telerik\Sitefinity3.0 folder is deleted.

    3. Install SP1.

    4. Create a project with SP1.

    5. Copy the old project database to the ~/App_Data folder if you are using SQL Express. If you are using SQL Server, in the project web.config file, edit the connection string to point to the old project database. This will upgrade the database automatically when the application is started for the first time.

    6. Copy all custom files from the old project to the new project. These include user controls, scrpits, images, css files, master pages, dll files, etc. If you have made changes to the Admin folder, compare the old files to the new ones and merge the changes.


    Kind regards,
    Rebecca
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  13. bnye
    bnye avatar
    332 posts
    Registered:
    22 Sep 2005
    04 Jul 2007
    Link to this post
    If you want a simple UserControl that is similar to the anchoredlist but doesn't have the links at the top of the page just the back to tops after each item this works well.

    <id="top" href="#"></a> 
     
        <asp:Repeater ID="listItems" runat="server">  
            <ItemTemplate> 
                <div class="SimpleListItemWrapper">  
                <div class="SimpleListItemHeaderWrapper">  
                    <id="<%# DataBinder.Eval(Container, "ItemIndex") %>"></a> 
                    <%# Eval("Headline")%> 
                </div> 
                <div class="SimpleListItemContentWrapper">  
                    <%# Eval("Content")%> 
                </div> 
                <div class="ListSimpleItemBackTopWrapper">  
                    <href="#top" id="backToTop" title="Back to the top of the page" class="ListItemBackTop">  
                        Back to top</a> 
                </div> 
                </div> 
            </ItemTemplate> 
        </asp:Repeater> 

    And then the code behind

    Imports System  
    Imports System.Data  
    Imports System.Configuration  
    Imports System.Collections  
    Imports System.Web  
    Imports System.Web.Security  
    Imports System.Web.UI  
    Imports System.Web.UI.WebControls  
    Imports System.Web.UI.WebControls.WebParts  
    Imports System.Web.UI.HtmlControls  
    Imports System.ComponentModel  
    Imports Telerik.Cms.Web.UI  
    Imports Telerik.Lists  
    Imports System.Collections.Generic  
     
    Partial Class UserControls_SimpleListTemplate  
        Inherits System.Web.UI.UserControl  
        Implements Telerik.Lists.IListDisplay  
     
        Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load  
            Try  
                If Not Page.IsPostBack Then  
                    RebindData()  
                End If  
            Catch ex As Exception  
     
            End Try  
        End Sub  
     
        Private Sub RebindData()  
            Try  
                If Not ListsIds Is Nothing Then  
                    Dim manager As New ListManager()  
                    Dim list As New ArrayList()  
                    For Each id As Guid In ListsIds  
                        Dim s As String = id.ToString  
                        list.AddRange(manager.GetListItems(id))  
                    Next  
     
                    listlistItems.DataSource = list  
                    listItems.DataBind()  
     
     
                End If  
            Catch ex As Exception  
     
            End Try  
        End Sub  
     
        <Category("Data")> _  
        Public Property ProviderName() As String Implements Telerik.Lists.IListDisplay.ProviderName  
            Get  
                Return _providerName  
            End Get  
            Set(ByVal value As String)  
                _providerName = value 
            End Set  
        End Property  
     
        <TypeConverter("Telerik.Lists.WebControls.ListsIdsConverter, Telerik.Lists")> _  
        <WebEditor("Telerik.Lists.WebControls.ListSelector, Telerik.Lists")> _  
        Public Property ListsIds() As Guid() Implements Telerik.Lists.IListDisplay.ListsIds  
            Get  
                Return _listsIds  
            End Get  
            Set(ByVal value As Guid())  
                _listsIds = value 
            End Set  
        End Property  
     
        Private _listsIds() As Guid  
        Private _providerName As String  
    End Class 

    Sincerely,

    Ben
  14. Vassil Daskalov
    Vassil Daskalov avatar
    261 posts
    Registered:
    18 May 2013
    09 Jul 2007
    Link to this post
    Hi bnye,

    Another solution for removing the top links would be to modify the ~/Sitefinity/ControlTemplates/Lists/AnchorListTemplate.ascx template by setting the visible attribute of the first repeater to false. This is in case the Mode property of the Sitefinity List control is set to AnchorList.

    All the best,
    Vassil Daskalov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Register for webinar
14 posts, 0 answered