Added type select to sidebar.
Implemented type-select for grid view (Issue #428).
Little code cleanup for grid view.