Completed
Last Updated: 18 Mar 2021 09:09 by ADMIN
Release 2.23.0
Sylvain
Created on: 17 Oct 2019 09:56
Category: Grid
Type: Feature Request
27
Hide column only on small device

Hi !

How can i hide some columns on small device ?

Telerik.Blazor.Components.GridColumn.Class does not exist ?

Regards,

 

--------

ADMIN EDIT

This will be done through the Visible parameter of the column. You can bind it to a flag that hides the column for the desired scenarios (resolution, user settings, etc.). The new feature we provide to facilitate this will be a MediaQuery component that lets you have an easy flag in the C# code based on the media query for the desired resolution. There will be a demo how to use it with the grid columns when the 2.23.0 release is live. With this approach you will still use a CSS media query, but this will give you more flexibility to use it in more functionality than just the grid columns, and will avoid adding extra properties to the column.

--------

4 comments
ADMIN
Marin Bratanov
Posted on: 18 Mar 2021 09:09

Hello,

This will be done through the Visible parameter of the column. You can bind it to a flag that hides the column for the desired scenarios (resolution, user settings, etc.). The new feature we provide to facilitate this will be a MediaQuery component that lets you have an easy flag in the C# code based on the media query for the desired resolution. There will be a demo how to use it with the grid columns when the 2.23.0 release is live. With this approach you will still use a CSS media query, but this will give you more flexibility to use it in more functionality than just the grid columns, and will avoid adding extra properties to the column.

 

Regards,
Marin Bratanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

ADMIN
Marin Bratanov
Posted on: 21 Sep 2020 10:39

Hello again,

An update after 2.17.0 - the columns have a Visible parameter that makes hiding them easier and lets you keep their order: https://docs.telerik.com/blazor-ui/components/grid/columns/visible. While the stocks app linked before is not yet updated to use it, the approach of using a flag from the view-model is still the same, just the Grid markup is simpler.

 

Regards,
Marin Bratanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

ADMIN
Marin Bratanov
Posted on: 21 Jan 2020 14:32

Another example is available in our new sample app - https://github.com/telerik/blazor-stocks. Ed's BlazorSize package also lets you test media queries even though this is not used in this sample. Basically, a boolean flag is updated on the window.resize event.

 

Regards,
Marin Bratanov
Progress Telerik

 UI for Blazor
ADMIN
Marin Bratanov
Posted on: 17 Oct 2019 13:08

Hi Gilles,

You can have columns wrapped in conditional markup so they only render when you want them to render. A similar example is available in the following demo: https://demos.telerik.com/blazor-ui/grid/columns. Of course, you would need to replace the button toggles from the demo with code that responds to the browser size (e.g.., a service that uses JS Interop for this).

Further, you can bind the Width values of the columns to other variables that can also get modified based on the screen size. You can also, for example, use variables for command buttons' texts and reset them to empty strings when on mobile to only show icons and save some more space.

At the moment, there is no other built-in option to do this. More mature suites we have provide mobile rendering, and perhaps after some time we will have something similar in Blazor as well, but for the time being this is not in our plans, because we need to focus on core functionality and additional components.

Nevertheless, I moved this thread to the Feedback portal so you can Follow its status (I have added your vote already). Here's a link for you: .

 

Regards,
Marin Bratanov
Progress Telerik

 UI for Blazor