Above provided solution by Mahendra.p25 is good as far as data are not larger.
For the larger records(may be 2000 up), this method may degrade the performance in terms of speed.So if you are targeting larger records in the DataGrid, go with custom paging.
Custom paging is method in which records are populated from database on demand. Let's consider you have page size of 20. So in the first page, only 20 records are needed. If use clicks on 2nd page, then data of that page should be loaded at that time and not at the page -1. Please find the links below for the custom paging implementation.
I would also suggest you to implement a custom control of the paging, so that you can re-use anywhere in the applicable and also in other applications as well.
Reference Link-1[
^]
Reference Link-2[
^]