Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all articles
Browse latest Browse all 7205

ASPxGridView - How to show the number of selected rows in the Pager bar

$
0
0

This example demonstrates how to show the number of selected rows in the Pager bar. It is necessary to create a custom PagerBar template for this purpose. This template will contain ASPxLabel that allows showing the number of selected rows and a standard pager created via the ASPxGridViewTemplateReplacement control:

[ASPx]
<PagerBar><table><tr><td><dx:ASPxGridViewTemplateReplacementrunat="server"ReplacementType="Pager"/></td><td><dx:ASPxLabelID="labelInfo"runat="server"Text=""ClientInstanceName="labelInfo"></dx:ASPxLabel></td></tr></table></PagerBar>

We can get the grid's selected row count via the client-side ASPxClientGridView.GetSelectedRowCount method and then set it to ASPxLabel using the label's SetText method:

[JavaScript]
function ShowRowsCount(){ labelInfo.SetText('Selected rows count: ' + gridView.GetSelectedRowCount());}
Question Comments

Added By: Patrick Saunders at: 8/30/2014 9:14:10 PM    

From here:
http://stackoverflow.com/questions/7808230/devexpress-how-do-get-an-instance-of-a-control-client-side-and-access-its-clien

Make sure to set the clientInstanceName, this caught me out for a while, you will get Javascript referrence errors.

Added By: Sandeep Agarwal 3 at: 8/31/2016 2:01:27 PM    I've the Pager displayed in both top and bottom of the ASPxgridView. But the selection count gets displayed only at the bottom. Is it possible to move it up ?

Viewing all articles
Browse latest Browse all 7205

Trending Articles



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