Suppose I have a table that shows 5 rows or records, with a fixed total of 12 records, that makes it have three pages so that one can page. But for example if I want to choose row 8, I need to get the page in which it is and save that value, that is, calculate and get the value of the page that is equal to "2". I would like to know how I could get that value 2, which is the page where the selected row is located.
Any idea how to do it, would I have to use any division of the row selected by the number of rows to show? I'm doing it in C #, but it does not matter the language, since it matters the algorithm