Quantcast
Viewing all articles
Browse latest Browse all 7205

GridView - How to create a custom "Select Page Size" element with the "Show All Records" feature

Problem:
I wish to implement custom paging elements with the capability to show all records.

Solution:
Generally, it is possible to override the template for the Pager area using the GridViewSettings.SetPagerBarTemplateContent(Action`1) method. However, in this scenario the entire area with your custom template will be hidden once you set the ASPxGridViewPagerSettings.Mode property to the ShowAllRecords value. This is expected behavior. To overcome it, you can leave the default page UI and add custom pager elements to the  Footer area by overriding its template instead using the GridViewSettings.SetFooterRowTemplateContent(Action`1) method.

Note 1: Currently, there is no capability to replicate the default UI of the GridView's specific visual element within a template of this element. We have discussed this topic in the S37728: Add the GridViewTemplateReplacement extension ticket.

Note 2: If necessary, you can display the "Show All Records" item in the "Select Page Size" element of the built-in pager without implementing custom templates:

[C#]
@Html.DevExpress().GridView(settings=>{settings.Name="GridView";settings.SettingsPager.PageSizeItemSettings.Visible=true;settings.SettingsPager.PageSizeItemSettings.ShowAllItem=true;...
[VB.NET]
@Html.DevExpress().GridView( _Sub(settings) settings.Name = "GridView" settings.SettingsPager.PageSizeItemSettings.Visible = True settings.SettingsPager.PageSizeItemSettings.ShowAllItem = True ...

Viewing all articles
Browse latest Browse all 7205

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>