Quantcast
Viewing all articles
Browse latest Browse all 7205

ASPxGridLookup - How to change the displayed text when all rows are selected


This example illustrates how to display a custom text inside ASPxGridLookup when all rows are selected.


To implement this scenario, perform the following steps:


Handle the ASPxGridLookup.ValueChanged event to pass some flag to the client side based on the lookup selection:


[JScript]
protected void gridLookup_ValueChanged(object sender, EventArgs e){ ASPxGridLookup gl = sender as ASPxGridLookup;if(gl.GridView.Selection.Count == gl.GridView.VisibleRowCount) gl.GridView.JSProperties["cp_selected"] = true;}

Then handle the client-side EndCallback event and set a custom text if our flag has the "true" value (i.e. all rows are selected):


[JScript]
function OnEndCallback(s, e){if(s.GetGridView().cp_selected){ s.GetInputElement().value = "(Select All)";delete(s.GetGridView().cp_selected);}}


Viewing all articles
Browse latest Browse all 7205

Trending Articles



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