Grid.Blazor icon indicating copy to clipboard operation
Grid.Blazor copied to clipboard

Component columns render nothing

Open Dunge opened this issue 3 years ago • 2 comments

My desire is to display a progress bar in one of my columns based on data that comes elsewhere than the grid query, and only use the grid entity's id to match up. Nothing fancy like a CRUD editor as in the samples.

Based on this documentation page I added a component column in my grid:

Columns.Add().RenderComponentAs(typeof(TaskProgress));

I then created a .razor file with my component and added a Item [Parameter] of the type of my Grid entity as documented. Strangely it told me the parameter needs to be public and not protected as in the sample..

Even with the most basic content (static "<h3>test</h3>" text), nothing appears in the grid. Component renders fine when I put it elsewhere in my page.

Any suggestion on how to debug why it is not showing up?

Dunge avatar Jun 14 '22 23:06 Dunge

Ok, this is something that is explained in the Render button, checkbox, etc. in a grid cell page but not the Custom columns page in the section mentioning it.

It's simply a matter the your component must @implements ICustomGridComponent<T>.

I suggest you add a quick note in the column doc page in order to prevent others to fall in the same hole. I'll leave this issue open for that, feel free to close!

Dunge avatar Jun 15 '22 04:06 Dunge

Thanks for your suggestion, The documentation has been updated.

gustavnavar avatar Jun 20 '22 10:06 gustavnavar