Inventory window is suddenly random!

My inventory window use to group items by type but now the icons are in alphabetical order, i dont like it, how do i change it back?

There are three icons top right of the inventory window that change looks and sorting. Two of those three allow you to sort on column.