I need access to the Row Data from within the Body Template; at the moment I can only get the Value of the passed in data. Will this be coming soon as I need to make a discission on what suite of controls to use for an upcoming project. Until this is possible the current grid is no use.
Hello David,
You can access the grid’s row object from the IgbCellTemplateContext in your BodyTemplate handler using the following code, where "GetBodyTemplate" would be hooked into the corresponding column's BodyTemplate property:
public RenderFragment GetBodyTemplate(IgbCellTemplateContext ctx) { IgbGridCellIdentifier id = ctx.Cell.Id;
IgbRowType row = this.GridRef.GetRowByIndex(id.RowIndex);
var dataItem = row.Data;
return@<div>your_template_here</div>; }
I hope this helps you. Please let me know if you have any other questions or concerns on this matter.
I tried the above sample and I get a System.InvalidOperationException cannot synchronously invoke a method without IJSInProcessRuntime
This error is thrown on the line below.
IgbRowType row = this.GridChecks.GetRowByIndex(id.RowIndex);