protected void ASPxGridView2_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e) { try { switch (e.Parameters) { case "ExpandAll": ASPxGridView2.ExpandAll(); break; case "CollapseAll": ASPxGridView2.CollapseAll(); break; } } catch (Exception ex) { ScriptManager.RegisterStartupScript(this, GetType(), "ErrorText", "CallError('Error: " + ex.Message + "');", true); } }