vini
vini

Reputation: 4722

How to do paging in datagrid asp.net?

I can't get paging to work in my DataGrid even though I set AllowPaging="true" and AllowCustomPaging="true"

enter image description here

It was working earlier but now I don't know what happened.

What do I need to change in order to make it work?

Upvotes: 0

Views: 2945

Answers (1)

vini
vini

Reputation: 4722

I had to set datagrid1.VirtualItemCount, as explained on msdn – DataGrid.VirtualItemCount, to the actual number of items in my data source since CustomPaging does not work without it.

So I added

datagrid1.VirtualItemCount = 200;

and it worked.

Upvotes: 1

Related Questions