Hierarchy grid. Excess column in left when we do not need grouping

Hello!

We use Radzen components. We have several pages with almost same grids. For less double-code we created our custom grid component and use it in all pages where we need data grid. We split our grid on two files, on razor layout and code-behind (like win forms or asp.net web forms).
Our razor layout is

Our code-behind is simple. It has only properties (with ParameterAttribute) and some handlers for buttons, like edit row, delete row and etc.

The main problem is in Template. We dont need it on 90% pages and if we dont pass RowsTemplate then on grid we still see column on left side and we can't hide it. For us only full remove Template section works, but we need Template for other pages where we need grouping rows.

On screenshot you can see that in one case we dont need hierarchy and column for wrap row stiil on page. And in other case we need column for wrap (or unwarp) row.

Our solution is make one base class for parameters and handlers and two razor pages which inherits from base class, but they have only one deffrent. One file has Template section and other does not.

Maybe is there one good solution for hide left column, just we did not see it?


Maybe you can use ShowExpandColumn property

1 Like

It works! Thank you :slightly_smiling_face:
We did this: ShowExpandColumn = @(RowsTemplate != null)

1 Like