Hide Grid View columns

Hi Everybody,

I want to hide few columns in grid view.

I can do it by making each control of grid view visible property to false.

But how can i do it in single line code for hiding multiple columns?

Is there any solution for this?



A wonderful question to me. I am recently also getting into the issue of gridview control. Since there is a visibility property, I am doubt if there is some one has a hide property. Anyway, I also have the same doubt as yours on the gridview column.

If you set the AutoDeclaration property on the control to yesyou will be able to access the code using the name of the control. You can then set the visibility property.


Name of the grid control is PackingSlipId. Once the AutoDeclaration property is set to yes, you can use the following code to hide/show the control in code.


Hi Rajendra,

I think you can directly click on the field that you want to hide and then right click > Hide.If you want to show again then right click>Show recipient. So why you are writing code I didn’t get you.This is a standard functionality available in our ax.


  • Krisheed

Hello Krisheed Immadi,

Yes you are right, we can hide and unhide the columns by standard AX. But my requirement was to make columns visible for set of user and hide for another set of users. Column visibility should be changed based on the users.

I wrote code to make each column visible & invisible based on users. Alternate solution can be security key concept but i am not sure whether we can do at grid level or not.