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

[Solved] drop down as page size selector for Grid (Razor view Engine)

11 Answers 153 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Karim
Top achievements
Rank 1
Karim asked on 25 Jan 2012, 02:20 PM
Hi,
Is it possible to set a drop down as page size selector for Grid in Razor view engine, i saw it in Aspx view but it does not exist in Razor.
Are there a solution ??
Waiting for your replies, thank you.

11 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 25 Jan 2012, 02:29 PM
Hi Karim,

I am not sure I understand your question. Could you please clarify?
If you want to choose the page size via DropDownList you need to configure your Grid like so:
.Pageable(pag=>pag.Style(GridPagerStyles.PageSizeDropDown))


Kind regards,
Petur Subev
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 Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now
0
Karim
Top achievements
Rank 1
answered on 25 Jan 2012, 04:01 PM
That's it :) thank you.
0
Snehal
Top achievements
Rank 2
answered on 28 Mar 2012, 09:56 AM
i have same issue 
0
Raj
Top achievements
Rank 1
answered on 02 Apr 2012, 09:58 AM
Hi

I have a telerik grid, and i have a razor mvc view.

I have the paging enabled for the grid and has NextPreviousAndNumeric in the paging configuration. But i also want to show the PagesizeDropDown. I can only add one of these to the grid. How can i add both . Please assist.

Thank you ..
0
Petur Subev
Telerik team
answered on 02 Apr 2012, 10:31 AM
Hi Raj,

To enable both options of the Pager you should define the Style like this:
.Pageable(paging => paging.PageSize(5).Style(GridPagerStyles.PageSizeDropDown|GridPagerStyles.PageInput))


Kind regards,
Petur Subev
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 Telerik Extensions for ASP.MET MVC, subscribe to their blog feed now.
0
Raj
Top achievements
Rank 1
answered on 02 Apr 2012, 11:19 AM
Hi,

Thank you that worked fine.

I just wanted to ask two more small things.

1) I wants to change the text footer text which says "Displaying items 1-10 of 50" , i changed it in the telerik.grid.js file to show like "Displaying 1-10 of 50" but it doesn't work and showing the same as "Displaying items 1-10 of 50".

2)when i click on a coloumn to sort , it sorting good. But i just wanted to add an underline to that coloumn , which the grid is sorted.

Please assist.

Thank you.
0
Dadv
Top achievements
Rank 1
answered on 02 Apr 2012, 03:03 PM
1- You can found this in the resources GridLocalization ("DisplayingItems" )

2- do you want the entire column to be highlight or only the header?
0
Dadv
Top achievements
Rank 1
answered on 02 Apr 2012, 05:22 PM
here the function for highlight the column :
 
 .ClientEvents(e=>e.OnDataBound("onDataBound"))

<script type="text/javascript">
    function onDataBound(e) {
        var th = $('.t-grid-header > tr > th > a > .t-arrow-down[style!="display: none;"]').parent().parent();
        th.each(function (index, e) {
            var index = $(this).parent($('tr')).first().children().index($(this));
            $('.t-grid tbody > tr').each(function (i, e) {
                $(this).children().eq(index).addClass('down');
            });
        });
        
        th = $('.t-grid-header > tr > th > a > .t-arrow-up[style!="display: none;"]').parent().parent();

        th.each(function (index, e) {
            var index = $(this).parent($('tr')).first().children().index($(this));
            $('.t-grid tbody > tr').each(function (i, e) {
                $(this).children().eq(index).addClass('up');
            });
        });
    }
</script> 

<style type="text/css">
.up{background-color: Red;}
.down{background-color: Yellow;}
</style>
0
Raj
Top achievements
Rank 1
answered on 03 Apr 2012, 07:11 AM
Hi,

Thanks a lot .. That worked well .

Have a great day.
0
Raj
Top achievements
Rank 1
answered on 03 Apr 2012, 07:56 AM
Hi,

One more small thing.

I am really sorry for worrying.

I just wanted to know is it possible to change the filter. When we click on filter on the grid, it bring up the pop up with options to filter

with "AND" , is it possible to have a OR filter than "AND".

Thank you
0
Dadv
Top achievements
Rank 1
answered on 03 Apr 2012, 08:29 AM
By default they are only AND command (for the moment), but you can do your own filter with custom binding (server and ajax)

If you want Telerik add a new feature, use the PITS and vote for it.

Regards,
Tags
Grid
Asked by
Karim
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Karim
Top achievements
Rank 1
Snehal
Top achievements
Rank 2
Raj
Top achievements
Rank 1
Dadv
Top achievements
Rank 1
Share this question
or