Class TreeGridCellTimeRenderer
Represents the class that loads the SfTimePicker as editor for TreeGridTimeColumn.
Inheritance
Inherited Members
Namespace: Syncfusion.UI.Xaml.TreeGrid.Renderers
Assembly: Syncfusion.Grid.WinUI.dll
Syntax
public class TreeGridCellTimeRenderer : TreeGridVirtualizingCellRenderer<TextBlock, SfTimePicker>, ITreeGridCellRenderer, IDisposable
Examples
this.treeGrid.CellRenderers.Remove("Time");
this.treeGrid.CellRenderers.Add("Time", new TreeGridCellTimeRendererExt());
public class TreeGridCellTimeRendererExt : TreeGridCellTimeRenderer
{
public override void OnInitializeDisplayElement(DataColumnBase dataColumn, TextBlock uiElement, object dataContext)
{
base.OnInitializeDisplayElement(dataColumn, uiElement, dataContext);
uiElement.Foreground = new SolidColorBrush(Colors.DarkOrange);
}
}
Constructors
TreeGridCellTimeRenderer()
Initializes a new instance of the TreeGridCellTimeRenderer class.
Declaration
public TreeGridCellTimeRenderer()
Methods
EndEdit(TreeDataColumnBase, Object, Boolean)
Ends the edit occuring on the cell.
Declaration
public override bool EndEdit(TreeDataColumnBase dc, object record, bool canResetBinding = false)
Parameters
Type | Name | Description |
---|---|---|
TreeDataColumnBase | dc | Specifies the TreeDataColumnBase. |
System.Object | record | Specifies the record. |
System.Boolean | canResetBinding | Indicates whether binding can be reset or not. |
Returns
Type | Description |
---|---|
System.Boolean | Returns True if the edit ends on the cell ; otherwise, False. |
Overrides
GetControlValue()
Gets the control value of the cell.
Declaration
public override object GetControlValue()
Returns
Type | Description |
---|---|
System.Object | Returns the control value as |
Overrides
OnEditElementLoaded(Object, RoutedEventArgs)
Invoked when the edit element(SfTimePicker) is loaded on the cell in column.
Declaration
protected override void OnEditElementLoaded(object sender, RoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The sender that contains the corresponding edit UIElement. |
Microsoft.UI.Xaml.RoutedEventArgs | e | The Microsoft.UI.Xaml.RoutedEventArgs instance containing the event data. |
Overrides
OnEditElementUnloaded(Object, RoutedEventArgs)
Invoked when the edit element(SfTimePicker) is unloaded on the cell in column.
Declaration
protected override void OnEditElementUnloaded(object sender, RoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | The sender that contains the corresponding edit UIElement. |
Microsoft.UI.Xaml.RoutedEventArgs | e | The Microsoft.UI.Xaml.RoutedEventArgs instance containing the event data. |
Overrides
OnInitializeDisplayElement(TreeDataColumnBase, TextBlock, Object)
Initialize the binding for display element of corresponding column.
Declaration
public override void OnInitializeDisplayElement(TreeDataColumnBase dataColumn, TextBlock uiElement, object dataContext)
Parameters
Type | Name | Description |
---|---|---|
TreeDataColumnBase | dataColumn | Specifies the TreeDataColumnBase. |
Microsoft.UI.Xaml.Controls.TextBlock | uiElement | Specifies the corresponding renderer element. |
System.Object | dataContext | Specifies the data context of the cell. |
Overrides
OnInitializeEditElement(TreeDataColumnBase, SfTimePicker, Object)
Method which is used to initialize the renderer element bindings with corresponding column values.
Declaration
public override void OnInitializeEditElement(TreeDataColumnBase dataColumn, SfTimePicker uiElement, object dataContext)
Parameters
Type | Name | Description |
---|---|---|
TreeDataColumnBase | dataColumn | Specifies the corresponding TreeDataColumnBase. |
SfTimePicker | uiElement | Specifies the corresponding renderer element. |
System.Object | dataContext | Specifies the data context of the cell. |
Overrides
ShouldGridTryToHandleKeyDown(KeyRoutedEventArgs)
Handles the key interaction with editor of corresponding column.
Declaration
protected override bool ShouldGridTryToHandleKeyDown(KeyRoutedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.UI.Xaml.Input.KeyRoutedEventArgs | e | The Microsoft.UI.Xaml.Input.KeyRoutedEventArgs instance containing the event data. |
Returns
Type | Description |
---|---|
System.Boolean | True if the parent grid should be allowed to handle keys; false otherwise. |