This is a migrated thread and some comments may be shown as answers.

Disable RadGrid Pager Buttons

0 Answers 83 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Charles
Top achievements
Rank 1
Charles asked on 17 Aug 2017, 07:15 PM

I had a simple question that I can't seem to find the answer to. On my RadGrid I am using a pager and I want the First/Last/Next/Previous buttons to disable dynamically depending on if they are on the first page or last page. I don't want to disappear, but just get disabled. I have attempted this chunk of code down below:

 

 if (e.Item is GridPagerItem)
            {
                GridPagerItem pagerItem = (GridPagerItem)e.Item;
                if (pagerItem.Paging.IsFirstPage)
                {
                    pagerItem.CssClass = "RadFirstPage";
                    ((Button)pagerItem.FindControl("ctl03")).Enabled = false;
                }
                else if (pagerItem.Paging.IsLastPage)
                    pagerItem.CssClass = "RadLastPage";
            }

 

but the button still is able to be clicked on and hovered over. I want it to be completely disabled and without any hover action. Any ideas/suggestions/solutions/alcohol?

No answers yet. Maybe you can help?

Tags
Grid
Asked by
Charles
Top achievements
Rank 1
Share this question
or