diff --git a/winui/DataGrid/Column-Types.md b/winui/DataGrid/Column-Types.md index 847309e48..663ab0995 100644 --- a/winui/DataGrid/Column-Types.md +++ b/winui/DataGrid/Column-Types.md @@ -1577,6 +1577,39 @@ this.dataGrid.Columns.Add(new GridTimeColumn() { HeaderText = "Delivered Time", Hide Submit Buttons from Dropdown Time Spinner in WinUI TimeColumn +### 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 %} + + + + + + + + + +{% endhighlight %} +{% endtabs %} + +WinUI DataGrid TimeColumn with Clear Button + ## 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. diff --git a/winui/DataGrid/Column-Types_images/winui-datagrid-TimeColumn-ShowClearButton.png b/winui/DataGrid/Column-Types_images/winui-datagrid-TimeColumn-ShowClearButton.png new file mode 100644 index 000000000..d136ff866 Binary files /dev/null and b/winui/DataGrid/Column-Types_images/winui-datagrid-TimeColumn-ShowClearButton.png differ diff --git a/winui/TreeGrid/Column-Type-images/winui-treegrid-TimeColumn-ShowClearButton.png b/winui/TreeGrid/Column-Type-images/winui-treegrid-TimeColumn-ShowClearButton.png new file mode 100644 index 000000000..657771de6 Binary files /dev/null and b/winui/TreeGrid/Column-Type-images/winui-treegrid-TimeColumn-ShowClearButton.png differ diff --git a/winui/TreeGrid/ColumnTypes.md b/winui/TreeGrid/ColumnTypes.md index fea6ef5aa..07261d6cf 100644 --- a/winui/TreeGrid/ColumnTypes.md +++ b/winui/TreeGrid/ColumnTypes.md @@ -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 %} + + + + + + + + + + +{% endhighlight %} +{% endtabs %} + +WinUI TreeGrid TimeColumn with Clear Button + ## 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.