Accessing ChildContent of FluentDataGrid From Another Component via RenderFragment #3109
-
Hello Folks, I came across the Workload where i need to Wrap a FluentDataGrid into Custom Component Which is Parent Of All where it does provide different features with satisfy the workload but the problem i was facing is Templating the FluentDataGrid from this Custom Component, Where i need to template the Fluent Data Grid from Custom Components RenderFragment Where i want Template Using TemplatedColumn, PropertyColumn but Unfortunely this wasn't possible Since we are not CascadingTheType and Value like Original FluentDataGrid Does Which Passes InternalGridContext to Achieve the Cascading, Therefore i'm looking solution on accessing internalGridContext or DifferentSolution to Achive this Desired Results. Really Appriciate, if you'll can provide guidence on this, Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
The internalgridcontext is what the name says: internal. It is not, and will, not be made available. Not sure what you mean with 'like original FluentDataGrid does' It is not really clear to me what you are trying to achieve but as a suggestion I'd point you to the Aspire Dashboard source code to see how they handled using the DataGrid. |
Beta Was this translation helpful? Give feedback.
-
Let me rephrase the question, Let's say I have Component Called CustomDataGrid.razor which wraps FluentDataGrid @typeParam TGridItem
<FluentDataGrid Items="@Items">
@ChildContent
</FluentDataGrid>
@code
{
[Parameter]
Public IQueryable<TGridItem> Items { get; set; }
[Parameter]
Public RenderFragment? ChildContent { get; set; }
}
Now, Let's Use this Component <CustomDataGrid Items="@MyItems">
<TemplatedColumn Title="Name">
<FluentLabel>@context.Name</FluentLabel>
</TemplatedColumn>
<PropertyColumn Property="@(p => p.BirthDate)" Format="yyyy-MM-dd" Sortable="true" />
......
</CustomDataGrid> Can we achieve this? |
Beta Was this translation helpful? Give feedback.
Nevermind, I have managed to fix the issue by Adding CascadingTypeParameter as An Attribute