开发者

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

开发者 https://www.devze.com 2022-12-17 05:39 出处:网络
i ma using am listview and datapager control. in my list view i have specfiedtoshow30 records onceexceed thirtyrecords thenpagingcomes whererest of the resordsareshown.

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

精彩评论

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

关注公众号