Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 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.
29 changes: 29 additions & 0 deletions MAUI/DataGrid/columns.md
Original file line number Diff line number Diff line change
Expand Up @@ -383,5 +383,34 @@ this.dataGrid.Columns.RemoveAt(1);
{% endhighlight %}
{% endtabs %}

##Column Chooser

SfDataGrid allows you to show or hide columns at runtime by selecting or deselecting them in the Column Chooser. You can enable the column chooser by setting the ShowColumnChooser property.

You can also customize the Column Chooser header text by setting the ColumnChooserHeaderText property.

{% tabs %}
{% highlight xaml %}

<syncfusion:SfDataGrid x:Name="dataGrid"
ItemsSource="{Binding OrdersInfo}"
ShowColumnChooser="True">
<syncfusion:SfDataGrid.Columns>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the column initializations

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed Column Initializations.

<syncfusion:DataGridTextColumn MappingName="ID" HeaderText="Order ID"/>
<syncfusion:DataGridTextColumn MappingName="CustomerID" HeaderText="Name"/>
<syncfusion:DataGridTextColumn MappingName="ShipCity" HeaderText="City"/>
<syncfusion:DataGridTextColumn MappingName="ShipCountry" HeaderText="Country"/>
</syncfusion:SfDataGrid.Columns>
</syncfusion:SfDataGrid>

{% endhighlight %}

{% highlight c# %}

dataGrid.ShowColumnChooser = true;

{% endhighlight %}
{% endtabs %}

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