This example illustrates how to display a custom text inside ASPxGridLookup when all its rows are selected.
To implement this scenario, follow the steps below:
-
Handle the ASPxGridLookup.ValueChanged event to pass a flag to the client. The flag indicates whether all rows are selected.
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; }
-
On the client, handle the ASPxClientGridLookup.EndCallback event and specify a custom text if the flag returns true.
function OnEndCallback(s, e) { if (s.GetGridView().cp_selected) { s.GetInputElement().value = "(Select All)"; delete (s.GetGridView().cp_selected); } }
- Default.aspx (VB: Default.aspx)
- Default.aspx.cs (VB: Default.aspx.vb)