Copied to clipboard

Flag this post as spam?

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


  • Matthew Kirschner 323 posts 611 karma points
    Nov 21, 2016 @ 22:32
    Matthew Kirschner
    1

    GetGridHtml Recursive Call?

    I want to use the current or parent's DocType grid property in a view.

    Is there a way to make a call to GetGridHtml recursively, similar to GetPropertyValue's ability to pass a boolean as the second paramater?

  • Dennis Aaen 4499 posts 18254 karma points admin hq c-trib
    Jan 13, 2017 @ 13:59
    Dennis Aaen
    102

    Hi Matthew,

    In case that you donĀ“t have got it to work yet, or perhaps it can helps others :)

    Then you can do something like this.

    @Html.GetGridHtml(Model.Content.GetProperty("propertyAlias", recurse: true), "bootstrap3")
    

    Hope this helps,

    /Dennis

  • Matthew Kirschner 323 posts 611 karma points
    Jan 17, 2017 @ 16:09
    Matthew Kirschner
    1

    Thanks, Dennis.

    That worked! I was also able to drop the 'recurse:' text as Resharper informed me it was redundant. Here's the call I went with:

    @Html.GetGridHtml(Model.Content.GetProperty("propertyAlias", true), "bootstrap3")
    
  • Matthew Kirschner 323 posts 611 karma points
    Feb 27, 2017 @ 19:37
    Matthew Kirschner
    0

    I've found an issue with this recursive call. This only works if the grid property exists on the parent document type and not the child. If the child has the same grid property, then the recursive call will not work even if the child's grid is empty, which is exactly when I would want to defer to a parent's grid.

Please Sign in or register to post replies

Write your reply to:

Draft