Copied to clipboard

Flag this post as spam?

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


  • Roger Withnell 128 posts 613 karma points
    May 19, 2016 @ 13:19
    Roger Withnell
    0

    Use GridLayout alongside a vertical navbar

    I'm using Bootstrap to construct a vertical navbar on the left hand side 2 columns wide and the body the remaining 10 columns wide.

    When I use a GridLayout in the 10 columns, it renders 12 columns wide, because, I think, of the container class in the grid layout mark-up.

    Not sure how to fix this problem. I would appreciate your suggestion.

    Thanking you in anticipation.

    Roger

  • Dennis Adolfi 1082 posts 6446 karma points MVP 5x c-trib
    May 19, 2016 @ 13:32
    Dennis Adolfi
    0

    Hi Roger.

    Did you set the amount of columns on your GridLayout? You can configure a GridLayout to only use 10 columns instead of 12 by editing the datatype of your grid under developer. Se image:

    enter image description here

  • Roger Withnell 128 posts 613 karma points
    May 19, 2016 @ 14:44
    Roger Withnell
    0

    Thanks. I had tried this but when adding a row it still inserts a container class which is 1170 pixels wide.

  • Nik 1593 posts 7151 karma points MVP 6x c-trib
    May 19, 2016 @ 15:00
    Nik
    100

    Hi Roger,

    If you are using the grid in this manner, you might want to consider creating your own render template. This way you can edit what classes get put where and what containers. Infact, you could probably remove the containers all together as for your scenario they may not be needed.

    Then when you call the grid rendering code you just pass in the name of the new template to use to render it.

  • Roger Withnell 128 posts 613 karma points
    May 19, 2016 @ 16:31
    Roger Withnell
    0

    Thanks, Nik. Fixed!

    GridGetHtml defaulted to Partials > Grid > Bootstrap3.cshtml for rendering.

    I copied this file (CustomBootstrap3.cshtml) and only changed the class="container" to class="container-fluid". This uses percentages instead of pixels and fixed the problem.

    I called CustomBoostrap3.cshtml with:

    @CurrentPage.GetGridHtml("gridLayout", "CustomBootstrap3")

    Bingo!

  • Nik 1593 posts 7151 karma points MVP 6x c-trib
    May 19, 2016 @ 17:58
    Nik
    0

    no problem Roger.

    That template can be customised as much as you like, it allows you to use different frameworks if you don't want to be using Bootstrap as well. So other grids like Foundation can be used.

Please Sign in or register to post replies

Write your reply to:

Draft