You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MAUI/DataGrid/Column-types.md
+91Lines changed: 91 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1584,6 +1584,97 @@ internal class ItemsSourceSelector : IItemsSourceSelector
1584
1584
1585
1585
You can download the sample from the following link: (Sample)[https://github.com/SyncfusionExamples/How-to-load-different-items-for-each-row-in-MultiColumn-ComboBox-Column-in-.NET-MAUI-SfDataGrid].
1586
1586
1587
+
## DataGridHyperlinkColumn
1588
+
1589
+
The `DataGridHyperlinkColumn` inherits all the properties of the `DataGridTextColumn`. It displays column data as clickable hyperlinks. It renders link text in each record cell and lets end users invoke navigation.
DataGridHyperlinkColumn hyperlinkColumn = new DataGridHyperlinkColumn()
1606
+
{
1607
+
MappingName = "Country",
1608
+
HeaderText = "Country",
1609
+
};
1610
+
dataGrid.Columns.Add(hyperlinkColumn);
1611
+
1612
+
{% endhighlight %}
1613
+
1614
+
{% endtabs %}
1615
+
1616
+
You can enable end-users to navigate to a URI either when the cell value contains a valid URI address or by handling the `DataGridCurrentCellRequestNavigatingEventArgs` event. The `CurrentCellRequestNavigating` event is triggered whenever a cell in the `DataGridHyperlinkColumn` is clicked for navigation.
1617
+
1618
+
The `DataGridCurrentCellRequestNavigatingEventArgs` associated with the `CurrentCellRequestNavigating` event provides details about the hyperlink that initiated the action. Its `DataGridCurrentCellRequestNavigatingEventArgs.NavigateText` property returns the value from the column’s `DisplayBinding` if one is defined; otherwise, it falls back to the value bound to `MappingName`.
You can set the hyperlink text color using the `HyperlinkTextColor` property. If both HyperlinkTextColor and a DataGridCell TextColor (via implicit or explicit styles) are defined, HyperlinkTextColor takes precedence and will be used. If HyperlinkTextColor is not specified, the implicit or explicit cell styles will determine the hyperlink text color.
The row header is a type of column that is placed as the first cell of each row and remains frozen. To enable the row header, set [SfDataGrid.ShowRowHeader](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.DataGrid.SfDataGrid.html#Syncfusion_Maui_DataGrid_SfDataGrid_ShowRowHeader) to `true` Additionally, the `SfDataGrid` allows you to customize the row header width using the [SfDataGrid.RowHeaderWidth](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.DataGrid.SfDataGrid.html#Syncfusion_Maui_DataGrid_SfDataGrid_RowHeaderWidth) property. The default value is `30.`
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.
0 commit comments