Put the datagrid into a container, give that container “overflow-x: scroll;”, and change the width of the datagrid to a static amount. You’ll need to tinker with the width to make it a good size to show all of the columns.
The datagrid’s paging and search functions will probably need to be changed too to allow for them to stay visible to the user.
for the rows you can click on the datagrid, you will have the number of rows, put the number to 5.
If it is for the column, i guess there is no easy way to do it, maybe you can create several pages, in the first page display datagrid of 5 column, on the other page datagrid of 5 other column etc…
but when you will pass to a page on another you will loose the pagination state, if you know that you will not have a lot of rows you can set the number of rows to 100 for example.