How do you show x items per row in a repeater?

前端 未结 7 2005
予麋鹿
予麋鹿 2020-12-19 12:49

Anyone have any clue on how to show 4 items going horizontal with a repeater? A repeater shows items going down by default. Here is my test repeater code so far:



        
7条回答
  •  清歌不尽
    2020-12-19 13:33

    Modifying Nick's suggestion I was able to use to make a 5 horizontal x n vertical Image Grid. Thanks Nick!

    
        
            
            <%# (Container.ItemIndex != 0 && Container.ItemIndex % 5 == 0) ? @"" : string.Empty %>
            
            
    " />
    <%# DataBinder.Eval(Container.DataItem, "COLOR_NAME") %>

    And here's ColorThumbnailImage

     protected string ColorThumbnailImage(string fileName)
    {
        return Request.ApplicationPath + MySports.System.Configuration.ColorSquareImageLocation + fileName;
    }
    

提交回复
热议问题