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

How to disable/hide the navigation buttons after selecting SHOW ALL in RadGrid Paging

1 Answer 100 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Noel
Top achievements
Rank 1
Noel asked on 25 Sep 2012, 11:40 AM
I've added the "ALL" option to the PageSizeComboBox in RadGrid.
Very similar to this option: http://www.telerik.com/community/forums/aspnet/grid/how-to-add-show-all-option-in-radgrid-paging.aspx#1697877 

Everything works fine, but when I select 'ALL', the navigation buttons are there. 
Unfortunately, when I click on them, they crash my website.

Is it possible to disable or hide the navigation button in RADGrid Paging when the 'ALL' option is selected?
How can I access the navigation buttons in the server side code. 
I tried using this as somebody in some other thread had mentioned in Item_Created Event:
if (e.Item is GridPagerItem) Button prev = ((Button)e.Item.FindControl("Button1")) 
But it doesnt work. Please help.

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 28 Sep 2012, 06:48 AM
Hi Noel,

You could use the following approach to hide the paging buttons:
  mark-up:
<ClientEvents OnGridCreated="gridCreated" />
  JavaScript:
function gridCreated(sender, args) {
    if (sender.get_masterTableView().get_pageCount() <= 1) {
        var gridElement = sender.get_element();
        gridElement.getElementsByClassName("rgPageFirst")[0].style.display = "none";
        gridElement.getElementsByClassName("rgPagePrev")[0].style.display = "none";
        gridElement.getElementsByClassName("rgPageNext")[0].style.display = "none";
        gridElement.getElementsByClassName("rgPageLast")[0].style.display = "none";
    }
}

I hope this will prove helpful.

All the best,
Eyup
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Noel
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or