Check if grid is grouped or filtered

I have a grid that can either be grouped or filtered by Column 1. It is one or the other (cannot be both). I have different code that needs to be run depending on whether the grid is grouped or filtered. Is there a way to check to see if the grid is grouped or not, or check to see if the grid if filtered or not.

Thank you.

Unfortunately there are no such methods but you may create a custom flag and change accordingly to the state of your grid.
For example:

mygrid.groupBy(2) group_state="true"; ... mygrid.unGroup(); group_state="false";