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

[Solved] Bug: GridPagerSettingsBuilder Does Not Allow Total Value Of 0

1 Answer 45 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.
Kevin Watkins
Top achievements
Rank 1
Kevin Watkins asked on 11 Jan 2010, 06:23 PM
Hi,

The GridPagerSettingsBuilder does not allow a Total value of zero, however zero is a perfectly acceptable value - you might be binding to an empty data set. Therefore the following throws an exception:

<%

= Html.Telerik().Grid<T>()

 

.Pageable(pager => pager.Total(0))


To fix change the method to:

public virtual GridPagerSettingsBuilder Total(int value)
{
   Guard.IsNotNegative(value, "value");

   pager.Total = value;

   return this;
}


I've been using this fix in a custom build and it appears to work fine.

Cheers,

Kev

1 Answer, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 12 Jan 2010, 09:04 AM
Hi Kevin Watkins,

Thank you for reporting this problem and suggesting a solution. We have fixed this issue.

Regards,
Atanas Korchev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Grid
Asked by
Kevin Watkins
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or