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

[Solved] .Pageable in a Grid

3 Answers 159 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Marco
Top achievements
Rank 1
Marco asked on 02 Apr 2013, 11:11 AM
Hi all

I have a problem.
In my Grid i have the following Code for the part whit the pageable:

.Pageable(paging =>
           paging
               .PageSize(500)
               .Style(GridPagerStyles.Status)
               .Position(GridPagerPosition.Bottom)
       )

Now, when I have more than 500 Items, I can't go to this, then I don't allowed to click to another page in the part of .Style(...).
What can I do, to ask the Grid how many Items that I have, and when it's more than the 500, I allowed the paging?
But only in this situation. 
If I have less then thes 500 I would not to enable and see the Paging. Then I will only see the number of Items...

Thanks
Marco 

3 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 02 Apr 2013, 02:19 PM
Hello,

Please try with below code snipet.

.Pageable(x => x.PageSizes(new int[] { 10, 20, 30, 50 }))

Thanks,
Jayeh Goyani
0
Marco
Top achievements
Rank 1
answered on 03 Apr 2013, 06:24 AM
Hi

Thanks for the answer but it doesn't work.
What can I also try?

This is my complete Code under the columns:

.ClientEvents(events => events
    .OnDataBinding("Grid_onDataBinding")
    .OnError("Grid_onError"))
    .Editable(editing => editing.Mode(GridEditMode.InCell))
    .Scrollable(scrolling => scrolling.Enabled(false).Height("auto"))
    .TableHtmlAttributes(new { style = "table-layout = fixed" })
    .Resizable(resizing => resizing.Columns(true))
    .Sortable()
    .Filterable()
    .Groupable()           
    .Pageable(paging =>
        paging
            .PageSize(ViewBag.PageSize)
            .Style(GridPagerStyles.Status)
            .Position(GridPagerPosition.Bottom)
    )

To explain my Problem again:
If I have more Items in a Grid than the PageSize, I will allowed the function to go to an second or third site like this "< 1 2 3 >".
But when I have less Items then i defined in the PageSize, i woudn't see a function like this "< 1 >".

Thank you for your assistance

Marco
0
Eyup
Telerik team
answered on 05 Apr 2013, 11:19 AM
Hi Marco,

Are you using an ASP.NET RadGrid or another? Please note that you will need to select the respective product option for your chosen technology type.

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
Marco
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Marco
Top achievements
Rank 1
Eyup
Telerik team
Share this question
or