Class GridCellTimeRenderer
Represents the class that loads the SfTimePicker as editor for GridTimeColumn.
Inheritance
Inherited Members
Namespace: Syncfusion.UI.Xaml.DataGrid.Renderers
Assembly: Syncfusion.Grid.WinUI.dll
Syntax
public class GridCellTimeRenderer : GridVirtualizingCellRenderer<TextBlock, SfTimePicker>, IGridCellRenderer, IDisposable
Examples
this.sfDataGrid.CellRenderers.Remove("Time");
this.sfDataGrid.CellRenderers.Add("Time", new GridCellTimeRendererExt());
public class GridCellTimeRendererExt : GridCellTimeRenderer
{
public override void OnInitializeDisplayElement(DataColumnBase dataColumn, TextBlock uiElement, object dataContext)
{
base.OnInitializeDisplayElement(dataColumn, uiElement, dataContext);
uiElement.Foreground = new SolidColorBrush(Colors.DarkOrange);
}
}
Constructors
GridCellTimeRenderer()
Initializes a new instance of the GridCellTimeRenderer class.
Declaration
public GridCellTimeRenderer()
Methods
EndEdit(DataColumnBase, Object, Boolean)
Ends the edit occurs on the cell.
Declaration
public override bool EndEdit(DataColumnBase dc, object record, bool canResetBinding = false)
Parameters
Type | Name | Description |
---|---|---|
DataColumnBase | dc | Specifies the DataColumnBase. |
System.Object | record | Specifies the record. |
System.Boolean | canResetBinding | Indicates whether binding can be reset or not. |
Returns
Type | Description |
---|---|
System.Boolean | true if the edit ends on the cell; otherwise false. |
Overrides
GetControlValue()
Gets the control value.
Declaration
public override object GetControlValue()
Returns
Type |
---|
System.Object |
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. |
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. |
Microsoft.UI.Xaml.RoutedEventArgs | e | The Microsoft.UI.Xaml.RoutedEventArgs instance containing the event data. |
Overrides
OnInitializeDisplayElement(DataColumnBase, TextBlock, Object)
Method which initialize the display element of the column.
Declaration
public override void OnInitializeDisplayElement(DataColumnBase dataColumn, TextBlock uiElement, object dataContext)
Parameters
Type | Name | Description |
---|---|---|
DataColumnBase | dataColumn | Specifies the DataColumnBase. |
Microsoft.UI.Xaml.Controls.TextBlock | uiElement | Specifies the corresponding renderer element. |
System.Object | dataContext | Specifies the data context. |
Overrides
OnInitializeEditElement(DataColumnBase, SfTimePicker, Object)
Method which is used to initialize the renderer element bindings with corresponding column values.
Declaration
public override void OnInitializeEditElement(DataColumnBase dataColumn, SfTimePicker uiElement, object dataContext)
Parameters
Type | Name | Description |
---|---|---|
DataColumnBase | dataColumn | Specifies the DataColumnBase. |
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 | A Microsoft.UI.Xaml.Input.KeyRoutedEventArgs object. |
Returns
Type | Description |
---|---|
System.Boolean | True if the parent grid should be allowed to handle keys; false otherwise. |