There are different ways to provide this functionality for the Windows and ASP.NET parts of your XAF solution.
You can provide this functionality either via a couple of buttons (Select All/Unselect All) in the toolbar (using a ViewController with two SimpleAction) or yet better implement an unbound selection column directly in the grid control. These approaches were demonstrated in the following Code Central examples:
How to use an unbound check box column to select grid rows
Multiple selection using checkbox (web style)
To implement these solutions for the XtraGrid in XAF, refer to the Access Grid Control Properties in Windows Forms Applications help topic.
A similar approach should be used for the XtraTreeList control.
This feature is already supported by the ASPxGridListEditor and ASPxTreeListEditor. You can use a check box in the column header of the grid control. This functionality is controlled by the ShowSelectionColumn property: