Version

Collapse an Empty Cell

The xamDataCards™ control allows your end users to collapse (hide) empty cells in a card. You can enable this feature using one of the following techniques:

You can also prevent your end users from collapsing cells in a field by setting the FieldSettings object’s CollapseWhenEmpty property to False.

xamDataCards Collapse Empty Cells 01.png

The following example code demonstrates how to collapse a card. The Button control’s CommandParameter property is bound to the xamDataCards control’s ActiveRecord property.

In XAML:

<Button
    Content="Collapse or Expand Empty Cells in the Active Card"
    Command="{x:Static igDP:DataPresenterCommands.ToggleEmptyCardCellsCollapsedState}"
    CommandParameter="{Binding ElementName=xamDataCards1, Path=ActiveRecord}"
    CommandTarget="{Binding ElementName=xamDataCards1}" />
<igDP:XamDataCards Name="xamDataCards1" BindToSampleData="True">
    <igDP:XamDataCards.ViewSettings>
        <igDP:CardViewSettings CollapseEmptyCellsButtonVisibility="Visible" ShouldCollapseEmptyCells="True" />
    </igDP:XamDataCards.ViewSettings>
</igDP:XamDataCards>

In Visual Basic:

Me.xamDataCards1.ViewSettings.CollapseEmptyCellsButtonVisibility = Visibility.Visible
Me.xamDataCards1.ViewSettings.ShouldCollapseEmptyCells = True

In C#:

this.xamDataCards1.ViewSettings.CollapseEmptyCellsButtonVisibility = Visibility.Visible;
this.xamDataCards1.ViewSettings.ShouldCollapseEmptyCells = true;