Dear Syncfusion,
I am working with a grid, binded to an ExpandoObject, where the column names and even the number of columns are arbitrary. I managed to create the columns via c# code, using the following markup/code:
<SfGrid @ref="myGrid" DataSource="@Orders" Columns="@myCols">
@code {List<GridColumn> myCols = new List<GridColumn>();}
Now I have to define aggragates too, via code. I presume it should be something like this:
<SfGrid @ref="myGrid" DataSource="@Orders" Columns="@myCols" Aggregates="@myAggregates">
@code {List<GridAggregate> myAggregates = new List<GridAggregate>();}
But here I am lost. Do you have an example where I can see how to build the Aggregates, please?
Dear Renjith,
thanks for the quick answer. What I realised is that all my "problems" are related to one cardinal fact: I have to show in a grid a dataset, what changes. The number of columns, the name of the fields are depending on user interaction. The result itself arrives to me in an ExpandoObject, and I have to render it into the grid, with summaries, group summariest, etc.
It seems for me that the easiest way would be to generate the <SfGrid></SfGrid> part on the fly via c# code, however I have no idea how to inject the new markup into the page. It seems the MarkupString is not the good solution, and as a last resort I begun to study the RenderFragment.
Can you please guide me how can that be solved? Is that solveable at all as I imagined, or maybe Blazor is just not working that way? Clearly my knowledge is very limited in this.
Dear Renjith,
thank you for the example, and for your efforts to help to solve my problem.
With best regards:
Peter