gustavnavar / Grid.Blazor

Grid component with CRUD for Blazor (client-side and server-side) and ASP.NET Core MVC
GNU Lesser General Public License v2.1
705 stars 135 forks source link

Component columns render nothing #351

Closed Dunge closed 1 year ago

Dunge commented 2 years ago

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 "\

test\

" 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 commented 2 years ago

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!

gustavnavar commented 2 years ago

Thanks for your suggestion, The documentation has been updated.