Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Anja 13 posts 118 karma points
    Jul 28, 2017 @ 08:44
    Anja
    0

    Alternating row style in GridLayout

    Hello,

    is it possible to apply an alternating style to the rows of a gridlayout? I can apply the styles to each row container manually but like'd to do this without a content editor needing to do this. Somewhere must be a logic that pulls the rows with a foreach, this would be where I insert my own logic to determine the appropiate style.

    Regards

    Anja

  • Rune Hem Strand 147 posts 911 karma points hq c-trib
    Jul 28, 2017 @ 09:48
    Rune Hem Strand
    100

    Hi Anja

    Grid Layouts is rendered with a partial view. By default this is /Views/Partials/Grid/Bootstrap3.cshtml you can createyour own rendering by copying this file naming it something appropriate. Now you can modify the partial view all you want.

    When you render the grid you then need to call your custom rendering instead of the default one. If you named it: /Views/Partials/Grid/SomethingAppropriate.cshtml then you would do:

    @Html.GetGridHtml(Model.Content, "myProperty", "SomethingApropriate")
    

    See the documentation for more info.

    Hope that helps

    /Rune

  • Anja 13 posts 118 karma points
    Jul 28, 2017 @ 11:41
    Anja
    1

    Nice! Thank you.

Please Sign in or register to post replies

Write your reply to:

Draft