Hi all!
I have a Grid in CardView, the cards are compressed.I only want to show 1 uncompressed Card at one time, so is there a way to collapse all other uncompressed card?
I have founded already the AfterCardCompressedStateChanged Event, which is fired, when a user do a compress / uncompress, but waht is the code for this?Thanks in adv!
no idea?
Try this:
private void ultraGrid1_AfterCardCompressedStateChanged(object sender, AfterCardCompressedStateChangedEventArgs e) { // If a card is being collapsed, do nothing. if (e.NewCompressedState == CardCompressedState.Compressed) return; UltraGrid grid = (UltraGrid)sender; // Disabled this event so it does not fire recursively. // This is not strictly neccessary, since the code above will bail out when collapsing // a card, but it's more efficient for the event not to fire in the first place. grid.EventManager.SetEnabled(GridEventIds.AfterCardCompressedStateChanged, false); try { // Loop through all the rows. foreach (UltraGridRow row in e.Row.ParentCollection) { // Don't affect the row being expanded. if (row != e.Row) { // Collapse the card. row.IsCardCompressed = true; } } } finally { // Re-enabled the event grid.EventManager.SetEnabled(GridEventIds.AfterCardCompressedStateChanged, true); } }