A PagingRepeater control

Introduction

I found the need to page through a Repeater object in C#, as it is light weight and offers the flexibility that DataGrid doesn't have. There are a couple of bugs with the ViewState, but this is a work in progress and I hope that it will be resolved. The control works fine as-is though. Implementing the paging was inspired from the DataGrid directly, using Anakrino, the decompiler for .NET.

Using the control

The control can be added to your favourite control library, and then use the Add/Remove Control context menu on the Toolbox panel, to add the refence to the compiled dll. Dragging this to the page will generate the following:

<cc1:PagingRepeater id="PagingRepeater1" runat="server"></cc1:PagingRepeater>

Switching to design view at this point before building your templates is advised as once the templates contain data binding, the IDE will give you errors about switching to design view. I have attempted to implement a full range of features a leveraged already written code wherever possible.

I am open to suggestions and improvments on this class. As I use it in more and more real-world applications, it will become for feature complete.

You might also like...

Comments

Dan Glass

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“In theory, theory and practice are the same. In practice, they're not.”