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
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 ?