partial void collapseButton_Click(UIBarButtonItem sender) { if (sender.Title.Equals("Collapse")) { sender.Title = "Expand"; this.flexGrid.CollapseGroupsToLevel(0); } else { sender.Title = "Collapse"; foreach (var g in this.flexGrid.Rows) { if (g is GridGroupRow) { (g as GridGroupRow).IsCollapsed = false; } } } }