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

Relocate RadGrid Command Row

1 Answer 26 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jared Lewis
Top achievements
Rank 1
Jared Lewis asked on 30 Apr 2010, 04:47 PM
I have a requirement where the command row of the RadGrid must always be at the bottom of the grid. We have implemented code where the grid will be resized to always fit the container it lives in, but when paging is turned on, our page layouts become inconsistent because on some pages the paging row is the last row and on others the command row is the last row. So, I am wondering if there is a way to always make the command row show as the last row (or at least below the paging row) be it by server code or javascript. Anyone have a solution to this?

Thanks.

Jared

1 Answer, 1 is accepted

Sort by
0
Jared Lewis
Top achievements
Rank 1
answered on 30 Apr 2010, 06:00 PM
Well... with a little thought and jQuery at my side, here is my own solution to this issue:

 

var grid = $find('<%=Grid.ClientID %>');  
var pager = grid.PagerControl;  
 
if (pager != null)  
    FlipFlopCommandRow(pager);  
 
function FlipFlopCommandRow(Pager) {  
    //Deep copy the two rows to flip-flop  
    var cmdRow = $.extend(true, {}, $('.rgCommandRow', Pager));  
    var pagerRow = $.extend(true, {}, $('.rgPager', Pager));  
 
    //Remove existing rows  
    $('.rgCommandRow', Pager).remove();  
    $('.rgPager', Pager).remove();  
 
    //Add them back in the correct order  
    $(Pager).append(pagerRow);  
    $(Pager).append(cmdRow);  

...And now the pager row sits on top of the command row.

Jared
Tags
Grid
Asked by
Jared Lewis
Top achievements
Rank 1
Answers by
Jared Lewis
Top achievements
Rank 1
Share this question
or