This is a migrated thread and some comments may be shown as answers.

Hidden Columns

1 Answer 82 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Julian
Top achievements
Rank 1
Julian asked on 12 Aug 2019, 02:23 PM

Hi ,

 

I`ve had a look through the forum but could not find the answer I need. All I need to do is hide a column using .Hidden but for it to have 2 conditions. This is what I have already 

columns.Command(command => command.Custom("More Information").Click("moreInfo")).Width(180).Hidden(!ViewBag.IsAuthorized );

 

What I need is something 

 

columns.Command(command => command.Custom("More Information").Click("moreInfo")).Width(180).Hidden(!ViewBag.IsAuthorized  or blabla = something);

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 14 Aug 2019, 10:20 AM

Hi Julian,

 

The Hidden option for the columns accepts a single boolean value that controls whether the column will be displayed. However, if you would like to hide specific commands based on a more complex condition you can use the Visible option for a given command. The property accepts a JavaScript handler. The returned value from the function will determine if the command will be displayed.

Check out the article below that describes the functionality in more detail:

https://docs.telerik.com/aspnet-mvc/helpers/grid/how-to/editing/show-command-buttons-conditionally

 

Regards, Viktor Tachev
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
Grid
Asked by
Julian
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or