Expose DataGrid columns field

The RadzenGrid has a private property:

private List<RadzenGridColumn<TItem>> columns

that is very useful to change the column properties dynamically.

I have successfully implemented column visibility and order like you can do in OpenUI5 inheriting from the grid and changing the visibility of the columns with some code in the OnAfterRender method. I am accessing the columns field using reflection but it would be nice if the columns field was a public property.

[SOLVED - we got our reflection code working]

we have a similar need.
we would like to export what we see in a RadzenGrid to a PDF.
we are generating the PDF ourselves,and we just need to get Column Name and Type in the order as set up in the RadzenGrid.

Any suggestion on how we can get this info if you prefer not to expose this private field? so far our reflection code is not yet working :slight_smile:

We’ve added DataGrid ColumnsCollection property to latest Radzen.Blazor.

1 Like