Dear All,
I have a list of candidates and i'm using "Previous" and "Next" button to view candidates.
But for last page, i want to disable "Next" button.
And i dont want to use/create new variable/member as "Total No. of Records".
What I have tried:
private void ValidatePagination()
{
if (grdCandidate.Items.Count < ResultsPerPage || grdCandidate.Items.Count == 0)
btnNext.Enabled = false;
else
btnNext.Enabled = true;
if (_pageNumber == 1)
btnPrevious.Enabled = false;
else
btnPrevious.Enabled = true;
}
this code works fine, if grid count is lessthen max count or eqal to zero.
but for the last page, as its shows zero records.. its working fine.. but i dont want to allow user to get empty grid on last page.
for eg:
there are 10 records..
for page1 its shows 5 records
for page2 it will show next 5 records
for page3 it is showing 0 records...
i dont want to show zero rocords/empty gird to the user at the last page. How to disable the "Next" button here(on page2 but not on page3).
Can any one please help me...
Thanks