Script to Hide a DataGrid Column

Is there a way via scrip to hide a column in a DataGrid?   
I've seen similar questions posed but no answer directly to this.   

Example:  User enters a Sales Order line item.  Based on the Product Line of the Item, have certain columns show and hide others.

Thank you.