<Button sx={{ mb: 1 }} onClick={() => setRowSelection(!rowSelection)}>
  Toggle row selection
</Button>
<div style={{ height: 400 }}>
  <DataGridPremium
    rowSelection={rowSelection}
    checkboxSelection={rowSelection}
    cellSelection
    {...data}
  />
</div>