Quantcast
Viewing all articles
Browse latest Browse all 7205

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

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:

[JScript]
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.


Viewing all articles
Browse latest Browse all 7205

Trending Articles