# Selections history

Previously made selections are stored in a navigable history making it possible to navigate back and forward. You can also clear it and add bookmarks to apply known selection states at a later time. There are different ways of working with selections:

## Exclusive selections

Exclusive selections are selections that can be undone.

Example: Start an exclusive selection section in a list object

```
	    List<string> paths = new List<string>();
	     myListbox.BeginSelections(paths.ToArray());
```

Example: Resetting the made selection

You can reset the selections to their state at the start of the current exclusive selection section:

```
            myListbox.ResetMadeSelections();
```

Example: End an exclusive selection in a list object and also specify if the selection should be accepted or reset

```
            bool acceptSelection = true;
            myListbox.EndSelections(acceptSelection);
```

## Clearing selections in Qlik Sense objects

There are different ways of clearing selections in Qlik Sense objects. You can clear selections on specific column indices (in a hypercube) or you can clear all selections in a list object.

Example: Clear selections on specific column indices

```
            myListbox.ClearSelections(colIndices);
```

Example: Clear all selections in a list object

```
            myListbox.ClearSelections();
```

## Clearing selections in Qlik Sense apps

In addition to clearing all selections made in a Qlik Sense app, you can remove any applied locks in the process.

Example: Clear all selections made in a Qlik Sense app

```
            application.ClearAll();
```

Example: Clear all selections and remove any locks in a Qlik Sense app

```
            bool lockedAlso = true;
            application.ClearAll(lockedAlso);
```

## Moving back and forward in selections

You can move between different selection states, and it is also possible to find out how many stored selections there are in the selection queue or selection history.

You can find out how many stored selections are behind you in the selection queue based on your current selection state.

Example: Count the number of selections in the selection queue that are located behind your current selection state

```
            int backCount = application.BackCount();
```

You can move back to a previous selection.

Example: Move back to a previously made selection

```
            application.Back();
```

You can also move forward in the selection queue and find out how many stored selections are ahead of you in the selection queue based on your current selection state.

Information noteMoving forward in the selection queue requires that you have already moved back in the selection history.

Example: Count the number of selections in the selection queue that are located ahead of your current selection state

```
            int forwardCount = application.ForwardCount();
```

Example: Move forward to a later selection

```
            application.Forward();
```

Information noteMaking alterations to the selection state clears the queue from your current position forward.