ChildContent doesn't appear to exist on GridCommandButton

0 Answers 17 Views
Grid
Charles
Top achievements
Rank 1
Iron
Iron
Iron
Charles asked on 24 Feb 2022, 08:14 PM

Hello, per the documentation here:

https://docs.telerik.com/blazor-ui/components/grid/columns/command

Yet ChildContent doesn't appear to exist?  It doesn't come up in IntelliSense.  When I try using it anyhow, the text appears in red, or worse, ReSharper thinks it's a constant from some library that hasn't been imported:

Your examples don't show how to use ChildContent, so I'm making educated guesses.

I can get away from the "red text" by pointing it to a string:


<GridCommandButton Command="Test" ChildContent="@test"></GridCommandButton>

and

@code {
    private string test = "Test Content";
}

However I get compiler errors, so I don't think that's correct either.

It looks like the compiler is expected ChildContent to be a RenderFragment:


Error CS0030 Cannot convert type 'string' to 'Microsoft.AspNetCore.Components.RenderFragment' 

I can use the alternate method of putting the text between the tags:

<GridCommandButton Command="Test">Test</GridCommandButton>

I initially tried the ChildContent method because I can getting a warning I didn't initially understand when I tried using the text between the tags.  I now understand that was a ReSharper warning of no significance.

But I thought I'd point out docs for ChildContent appear to be incomplete?

Thanks.

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Charles
Top achievements
Rank 1
Iron
Iron
Iron
Share this question
or