As I am using a responsive HTML template that allows you to use the application even on small screen devices I would like, as for the listview control, that the datapager would adapt to the screen size by displaying limit page numbers to fit in the available
sizes. Unfortunately even using CSS I can't get this effect. Is there another way?
I'm using a responsive template for my webapp. When I load my webpage on a small screen listview fit to screen size cause css applied. This not happened for DataPager control because page number shown was fixed and not fit screen size.
There is a way to show only 3 DataPager page when load on small screen my web app and 6 page for large screen?
Sorry the requirement is not clear still, do you mean you want to dynamically set the pagesize of the datapager control? Show more records in large screen and less on small one?
Can you provide your current code so that we can see if it can be implemented to your webapp?
I believe the requirement is not to change the PageSize, but to reduce the DataPager's NumericPagerField ButtonCount based on screen size.
Clembo67, can you confirm that is what you are trying to do?
If so, the way to do that is to add two DataPagers, and hide the one you don't want to show using media queries in the CSS. The DataPager displays in a span, so target the appropriate span ID in the CSS.
If you need more than one breakpoint, go to 3 datapagers and add the CSS to "display:none" two of three, and only display one at each screen size.
Simple example with a ListView bound declaratively in the page:
Member
17 Points
231 Posts
Datapager responsive
Apr 05, 2020 08:28 AM|clembo67|LINK
As I am using a responsive HTML template that allows you to use the application even on small screen devices I would like, as for the listview control, that the datapager would adapt to the screen size by displaying limit page numbers to fit in the available sizes. Unfortunately even using CSS I can't get this effect. Is there another way?
Contributor
3140 Points
983 Posts
Re: Datapager responsive
Apr 06, 2020 08:16 AM|Yang Shen|LINK
Hi clembo67,
The requirement is not clear, let's take below demo from Using DataPager control with example in ASP.Net as an example, what do you want for this listview?
aspx:
cs:
Best Regard,
Yang Shen
Member
17 Points
231 Posts
Re: Datapager responsive
Apr 06, 2020 10:10 AM|clembo67|LINK
Hi Yang Shen,
I'm using a responsive template for my webapp. When I load my webpage on a small screen listview fit to screen size cause css applied. This not happened for DataPager control because page number shown was fixed and not fit screen size.
There is a way to show only 3 DataPager page when load on small screen my web app and 6 page for large screen?
I hope to have clarified despite my bad english
Contributor
3140 Points
983 Posts
Re: Datapager responsive
Apr 07, 2020 03:46 AM|Yang Shen|LINK
Hi clembo67,
Sorry the requirement is not clear still, do you mean you want to dynamically set the pagesize of the datapager control? Show more records in large screen and less on small one?
Can you provide your current code so that we can see if it can be implemented to your webapp?
Best Regard,
Yang Shen
Contributor
5961 Points
2466 Posts
Re: Datapager responsive
Apr 07, 2020 04:47 AM|KathyW|LINK
I believe the requirement is not to change the PageSize, but to reduce the DataPager's NumericPagerField ButtonCount based on screen size.
Clembo67, can you confirm that is what you are trying to do?
If so, the way to do that is to add two DataPagers, and hide the one you don't want to show using media queries in the CSS. The DataPager displays in a span, so target the appropriate span ID in the CSS.
If you need more than one breakpoint, go to 3 datapagers and add the CSS to "display:none" two of three, and only display one at each screen size.
Simple example with a ListView bound declaratively in the page: