简体   繁体   中英

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"

在此处输入图片说明

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

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM