Magento: Hide Column from Admin Grid

Here is a quick tip to hide any column from admin grid in Magento. Hiding columns in admin grid becomes necessary when you want those particular columns in exported csv or xml file but you don’t want to display them in the admin grid.

You can hide columns from admin grid by setting column_css_class and header_css_class as no-display to the column you want to hide in the addColumn function. This will hide your column from the admin grid. However, this column will be present when you export the grid data to csv or xml file.



$this->addColumn('YOUR_COLUMN_ID', array(
        'header'    => Mage::helper('YOUR_HELPER_NAME')->__('YOUR_COLUMN_NAME'),
        'width'     => '150px',
        'index'     => 'YOUR_COLUMN_INDEX',
        'column_css_class'=>'no-display',
        'header_css_class'=>'no-display',
  ));

Hope this helps. Thanks.