Is there a way to access the Grid row or cell settings from within a child control (partial or LeBlender)? I would even settle for being able to access the row name that the control is in.
I can already do this inside the Grid template (e.g. Fanoe.cshtml) but I want to access it at the control level for the container that it's in. I have already setup the grid settings to be applied at the row and cell level, I just don't know how to tap into it or if it's even possible.
Essentially, I want to have a carousel control adjust the height/width of the images based on grid cell setting (e.g. a class or id), or even on a pre-defined row name. It sounds like it should be fairly straightforward, but I'm struggling to find the right method to access it.
In the 'framework' rendering file (the default one is bootstrap3.cshtml in /views/partials/grid) , you can see a foreach loop that loops through each row, and calls 'renderRow'. It's possible to update this file on your project.. to check the name of the row being rendered and do something different:
Access row / cell settings from control
Is there a way to access the Grid row or cell settings from within a child control (partial or LeBlender)? I would even settle for being able to access the row name that the control is in.
I can already do this inside the Grid template (e.g. Fanoe.cshtml) but I want to access it at the control level for the container that it's in. I have already setup the grid settings to be applied at the row and cell level, I just don't know how to tap into it or if it's even possible.
Essentially, I want to have a carousel control adjust the height/width of the images based on grid cell setting (e.g. a class or id), or even on a pre-defined row name. It sounds like it should be fairly straightforward, but I'm struggling to find the right method to access it.
Hi schlubadub
In the 'framework' rendering file (the default one is bootstrap3.cshtml in /views/partials/grid) , you can see a foreach loop that loops through each row, and calls 'renderRow'. It's possible to update this file on your project.. to check the name of the row being rendered and do something different:
However maybe from what you are saying above, it might be worth investigating Anders' Skybrud.Umbraco.GridData package:
https://our.umbraco.org/projects/developer-tools/skybrudumbracogriddata/
and
https://github.com/skybrud/Skybrud.Umbraco.GridData
this package enables you to get a strongly typed model of the grid data eg:
if that helps...
is working on a reply...