开发者

Showing a DataPager for a ListView only when there are at least 30 records

i ma using am listview and datapager control. in my list view i have specfied to show 30 records once exceed thirty records then paging comes where rest of the resords are shown.

issue: when i have only 5 records even then my paging is shown(previous 1 next) even though the link button are disable of paging . i do not want to shown paging untill i exceed thirty records.

i need to shown the paging only when there is more than specfied recoreed开发者_如何学运维s to be shown in an page i do not want pging option to be shown even if i have 1 or 30 records

any help would be great

thank you


You can hide a NextPreviousPagerField object in a DataPager control by setting the Visible property to false. You can also hide the individual buttons (the first-page, previous-page, next-page, and last-page buttons) by setting the ShowFirstPageButton, ShowPreviousPageButton, ShowNextPageButton, and ShowLastPageButton properties to false.

MSDN Good luck trying it out ;). It will probably be something like

    if(results < 30) { DataPager1.Visible = false; }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜