Skip to content
Open
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
33 changes: 33 additions & 0 deletions winui/DataGrid/Column-Types.md
Original file line number Diff line number Diff line change
Expand Up @@ -1577,6 +1577,39 @@ this.dataGrid.Columns.Add(new GridTimeColumn() { HeaderText = "Delivered Time",

<img src="Column-Types_images/winui-datagrid-TimeColumn_ShowSubmitButtons-column.gif" alt="Hide Submit Buttons from Dropdown Time Spinner in WinUI TimeColumn" width="100%" Height="Auto"/>

### Clear Button support

The `GridTimeColumn` provides a clear button feature that enables users to reset cell values during editing using the **ShowClearButton** property.
When `ShowClearButton` is set to `True`, a clear button appears within the editor, providing users with a convenient way to clear the cell's value.

**AllowNull Behavior**

The behavior of the clear button depends on the [AllowNull](https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.GridTimeColumn.html#Syncfusion_UI_Xaml_DataGrid_GridTimeColumn_AllowNull) property:

- When `AllowNull` is `True`, clicking the clear button sets the cell value to `null`.

- When `AllowNull` is `False`, clicking the clear button keeps the cell value unchanged.

{% tabs %}
{% highlight xaml %}
<dataGrid:SfDataGrid x:Name="dataGrid"
ItemsSource="{Binding Orders}"
AutoGenerateColumns="False"
ColumnWidthMode="Star"
AllowEditing="True" >
<dataGrid:SfDataGrid.Columns>
<dataGrid:GridTextColumn MappingName="OrderID" HeaderText="Order ID" />
<dataGrid:GridTextColumn MappingName="CustomerID" HeaderText="Customer ID" />
<dataGrid:GridTextColumn MappingName="CustomerName" HeaderText="Customer Name" />
<dataGrid:GridTimeColumn MappingName="DeliveredTime" HeaderText="Delivered Time" ShowClearButton="True" />
<dataGrid:GridTextColumn MappingName="ShipCity" HeaderText="Ship City" />
</dataGrid:SfDataGrid.Columns>
</dataGrid:SfDataGrid>
{% endhighlight %}
{% endtabs %}

<img src="Column-Types_images/winui-datagrid-TimeColumn-ShowClearButton.png" alt="WinUI DataGrid TimeColumn with Clear Button" width="100%" Height="Auto"/>

## GridToggleSwitchColumn

[GridToggleSwitchColumn](https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.GridToggleSwitchColumn.html) derived from [GridColumn](https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.GridColumn.html) and it is used to display `Boolean` type data. It hosts [ToggleSwitch](https://docs.microsoft.com/en-us/windows/winui/api/microsoft.ui.xaml.controls.toggleswitch?view=winui-3.0) element as [GridCell](https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.DataGrid.GridCell.html) content.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions winui/TreeGrid/ColumnTypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -1220,6 +1220,43 @@ treeGrid.Columns.Add(new TreeGridTimeColumn()

For more information refer [here](https://help.syncfusion.com/winui/time-picker/time-restriction#select-time-as-you-scroll-spinner).

### Clear Button support

The `TreeGridTimeColumn` provides a clear button feature that enables users to reset cell values during editing using the **ShowClearButton** property.
When `ShowClearButton` is set to `True`, a clear button appears within the editor, providing users with a convenient way to clear the cell's value.

**AllowNull Behavior**

The behavior of the clear button depends on the [AllowNull](https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.TreeGrid.TreeGridTimeColumn.html#Syncfusion_UI_Xaml_TreeGrid_TreeGridTimeColumn_AllowNull) property:

- When `AllowNull` is `True`, clicking the clear button sets the cell value to null.
- When `AllowNull` is `False`, clicking the clear button keeps the cell value unchanged.

{% tabs %}
{% highlight xaml %}
<treeGrid:SfTreeGrid Name="treeGrid"
ColumnWidthMode="Star"
AllowEditing="True"
AutoExpandMode="AllNodesExpanded"
AutoGenerateColumns="False"
ChildPropertyName="ReportsTo"
ItemsSource="{Binding Employees}"
ParentPropertyName="ID"
SelfRelationRootValue="-1" >
<treeGrid:SfTreeGrid.Columns>
<treeGrid:TreeGridTextColumn MappingName="FirstName" HeaderText="First Name" />
<treeGrid:TreeGridTextColumn MappingName="LastName" HeaderText="Last Name" />
<treeGrid:TreeGridNumericColumn MappingName="ID" HeaderText="Employee ID" />
<treeGrid:TreeGridTimeColumn MappingName="ReportingTime" HeaderText="Reporting Time" ShowClearButton="True" />
<treeGrid:TreeGridTextColumn MappingName="Title" />
<treeGrid:TreeGridTextColumn MappingName="ReportsTo" HeaderText="Reports To" />
</treeGrid:SfTreeGrid.Columns>
</treeGrid:SfTreeGrid>
{% endhighlight %}
{% endtabs %}

<img src="Column-Type-images/winui-treegrid-TimeColumn-ShowClearButton.png" alt="WinUI TreeGrid TimeColumn with Clear Button" width="100%" Height="Auto"/>

## TreeGridCheckBoxColumn

[TreeGridCheckBoxColumn](https://help.syncfusion.com/cr/winui/Syncfusion.UI.Xaml.TreeGrid.TreeGridCheckBoxColumn.html) derived from `TreeGridColumn` and it used display and edit `Boolean` type data. It hosts `CheckBox` element as `TreeGridCell` content.
Expand Down