Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
43 changes: 43 additions & 0 deletions MAUI/DataGrid/columns.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,48 @@ this.dataGrid.Columns.RemoveAt(1);
{% endhighlight %}
{% endtabs %}

##Column Chooser

SfDataGrid allows you show or hide columns at runtime by selecting or deselecting them through the Column Chooser. You can enable this feature by setting the `SfDataGrid.ShowColumnChooser` property.

{% tabs %}
{% highlight xaml %}

<syncfusion:SfDataGrid x:Name="dataGrid"
ItemsSource="{Binding OrdersInfo}"
ShowColumnChooser="True">
</syncfusion:SfDataGrid>

{% endhighlight %}

{% highlight c# %}

dataGrid.ShowColumnChooser = true;

{% endhighlight %}
{% endtabs %}

###Column Chooser Header Text

You can also customize the header text of the Column Chooser using the `SfDataGrid.ColumnChooserHeaderText` property. By default, `SfDataGrid.ColumnChooserHeaderText` property is set to `string.Empty`, so the header is not displayed. If you assign any non-empty string, the header becomes visible.

{% tabs %}
{% highlight xaml %}

<syncfusion:SfDataGrid x:Name="dataGrid"
ItemsSource="{Binding OrdersInfo}"
ColumnChooserHeaderText="Select Visible Columns"
ShowColumnChooser="True">
</syncfusion:SfDataGrid>

{% endhighlight %}

{% highlight c# %}

dataGrid.ColumnChooserHeaderText = "Select Visible Columns";

{% endhighlight %}
{% endtabs %}

<img alt="Maui DataGrid Column Chooser" src="Images\columns/maui-datagrid-columnchooser.png" width="404"/>