Skip to content

Sections & Dynamic Content

Sections group cells together with optional headers and footers. They also support generating cells dynamically from data sources.

The basic building block for organizing cells into groups.

<tv:TableSection Title="GENERAL"
FooterText="These settings apply globally">
<tv:LabelCell Title="Item 1" />
<tv:LabelCell Title="Item 2" />
</tv:TableSection>
PropertyTypeDefaultDescription
Titlestring""Section header text
FooterTextstring""Section footer text
HeaderViewView?nullCustom header view (overrides Title)
FooterViewView?nullCustom footer view (overrides FooterText)
IsVisiblebooltrueShow/hide entire section
FooterVisiblebooltrueShow/hide footer only
UseDragSortboolfalseEnable reorder controls
PropertyTypeDefaultDescription
HeaderBackgroundColorColor?nullHeader background
HeaderTextColorColor?nullHeader text color
HeaderFontSizedouble-1Header font size
HeaderFontFamilystring?nullHeader font family
HeaderFontAttributesFontAttributes?nullHeader styling (Bold, Italic, None)
HeaderHeightdouble-1Fixed header height
PropertyTypeDefaultDescription
FooterTextColorColor?nullFooter text color
FooterFontSizedouble-1Footer font size
FooterBackgroundColorColor?nullFooter background

Replace the default text header or footer with any MAUI view:

<tv:TableSection>
<tv:TableSection.HeaderView>
<HorizontalStackLayout Padding="16,8" Spacing="8">
<Image Source="settings_icon.png" HeightRequest="20" />
<Label Text="PREFERENCES"
FontAttributes="Bold"
VerticalOptions="Center" />
</HorizontalStackLayout>
</tv:TableSection.HeaderView>
<tv:SwitchCell Title="Notifications" On="{Binding Notifications}" />
<tv:TableSection.FooterView>
<Label Text="Manage how you receive alerts"
Padding="16,4"
FontSize="12"
TextColor="Gray" />
</tv:TableSection.FooterView>
</tv:TableSection>

Sections can generate cells dynamically from a data source. The section observes INotifyCollectionChanged for live add/remove updates.

<tv:TableSection Title="Tasks"
ItemsSource="{Binding Tasks}">
<tv:TableSection.ItemTemplate>
<DataTemplate>
<tv:CheckboxCell Title="{Binding Name}"
Checked="{Binding IsComplete, Mode=TwoWay}" />
</DataTemplate>
</tv:TableSection.ItemTemplate>
</tv:TableSection>
PropertyTypeDefaultDescription
ItemsSourceIEnumerable?nullData source for generated cells
ItemTemplateDataTemplate?nullTemplate for each item
TemplateStartIndexint0Insert position among static cells

Use TemplateStartIndex to control where dynamic cells are inserted among static cells:

<tv:TableSection Title="Items"
ItemsSource="{Binding Items}"
TemplateStartIndex="1">
<!-- Static cell at index 0 (always first) -->
<tv:CommandCell Title="Add New Item"
Command="{Binding AddItemCommand}" />
<!-- ItemTemplate cells inserted starting at index 1 -->
<tv:TableSection.ItemTemplate>
<DataTemplate>
<tv:LabelCell Title="{Binding Name}"
ValueText="{Binding Value}" />
</DataTemplate>
</tv:TableSection.ItemTemplate>
</tv:TableSection>

The TableView itself supports generating entire sections from a data source:

<tv:TableView ItemsSource="{Binding Categories}">
<tv:TableView.ItemTemplate>
<DataTemplate>
<tv:TableSection Title="{Binding CategoryName}">
<tv:LabelCell Title="{Binding Description}" />
</tv:TableSection>
</DataTemplate>
</tv:TableView.ItemTemplate>
<tv:TableRoot>
<!-- Static sections can coexist with dynamic ones -->
<tv:TableSection Title="Static Section">
<tv:LabelCell Title="Always visible" />
</tv:TableSection>
</tv:TableRoot>
</tv:TableView>

Show or hide sections and footers dynamically:

<tv:TableSection Title="Advanced"
IsVisible="{Binding ShowAdvanced}"
FooterText="These options are for power users"
FooterVisible="{Binding ShowFooter}">
<tv:EntryCell Title="Custom Server"
ValueText="{Binding CustomServer, Mode=TwoWay}" />
</tv:TableSection>

Setting IsVisible="False" hides the entire section including header, cells, and footer. Setting FooterVisible="False" hides only the footer while keeping the rest visible.