Skip to content

Commit b291fe5

Browse files
Merge pull request #3825 from syncfusion-content/DataGrid_ColumnChooserUG
Provided UG for DataGridColumnChooser
2 parents 84f59ec + 9cf3148 commit b291fe5

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed
42 KB
Loading

MAUI/DataGrid/columns.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -383,5 +383,48 @@ this.dataGrid.Columns.RemoveAt(1);
383383
{% endhighlight %}
384384
{% endtabs %}
385385

386+
##Column Chooser
386387

388+
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.
389+
390+
{% tabs %}
391+
{% highlight xaml %}
392+
393+
<syncfusion:SfDataGrid x:Name="dataGrid"
394+
ItemsSource="{Binding OrdersInfo}"
395+
ShowColumnChooser="True">
396+
</syncfusion:SfDataGrid>
397+
398+
{% endhighlight %}
399+
400+
{% highlight c# %}
401+
402+
dataGrid.ShowColumnChooser = true;
403+
404+
{% endhighlight %}
405+
{% endtabs %}
406+
407+
###Column Chooser Header Text
408+
409+
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.
410+
411+
{% tabs %}
412+
{% highlight xaml %}
413+
414+
<syncfusion:SfDataGrid x:Name="dataGrid"
415+
ItemsSource="{Binding OrdersInfo}"
416+
ColumnChooserHeaderText="Select Visible Columns"
417+
ShowColumnChooser="True">
418+
</syncfusion:SfDataGrid>
419+
420+
{% endhighlight %}
421+
422+
{% highlight c# %}
423+
424+
dataGrid.ColumnChooserHeaderText = "Select Visible Columns";
425+
426+
{% endhighlight %}
427+
{% endtabs %}
428+
429+
<img alt="Maui DataGrid Column Chooser" src="Images\columns/maui-datagrid-columnchooser.png" width="404"/>
387430

0 commit comments

Comments
 (0)