I'm wondering if you update your Grid Renderer file in /views/partials/grid/
Bootstrap3-Fluid.cshtml (or Boostrap3.cshtml or similar if you are using a custom one).
And update the bit that renders the particular editor:
<div @RenderElementAttributes(area)>
@{ int gridIndex = 0; }
@foreach (var control in area.controls)
{
if (control != null && control.editor != null && control.editor.view != null)
{
<text>@Html.Partial("grid/editors/base", (object)control, new ViewDataDictionary { { "gridCol", area.grid }, { "gridIndex", gridIndex } })</text>
}
gridIndex++;
}
</div>
To pass through the current index (and grid cell number if that's useful to know too), through to the particular editor via the MVC ViewBag...
Then in your editor partial view in /views/partials/grid/editors
you could read the values from the ViewBag like so:
int gridCellCol = 0;
Int32.TryParse(ViewData["gridCol"].ToString(), out gridCellCol);
int gridEditorIndex = 0;
Int32.TryParse(ViewData["gridIndex"].ToString(), out gridEditorIndex);
and then you'd have the context of what position the 'editor' was used in and the index number...
Index number of Grid Content in DTGE Grid
Is there any way to get what is the position of a grid element being used in it's view?
Hi Arun
I'm wondering if you update your Grid Renderer file in /views/partials/grid/
Bootstrap3-Fluid.cshtml (or Boostrap3.cshtml or similar if you are using a custom one).
And update the bit that renders the particular editor:
To pass through the current index (and grid cell number if that's useful to know too), through to the particular editor via the MVC ViewBag...
Then in your editor partial view in /views/partials/grid/editors
you could read the values from the ViewBag like so:
and then you'd have the context of what position the 'editor' was used in and the index number...
... is that what you are after?
regards
Marc
Thanks Marc
This is what I was looking for :)
Thank you for giving the solution.
-Arun
is working on a reply...