Category / Section
How to change the columns FontSize and InputScope in WinRT DataGrid?
1 min read
In SfDataGrid, TextBlock is initially loaded for displaying the data. When you enter edit mode, SfNumericTextBox is loaded for GridNumericColumn.
Changing InputScope of SfNumericTextBox
By override the OnCreateEditUIElement () from the GridCellNumericRenderer you can change the InputScope directly to SfNumericTextBox.
C#
this.sfDataGrid.CellRenderers.Remove("Numeric"); this.sfDataGrid.CellRenderers.Add("Numeric", new GridCellNumericRendererExt()); public class GridCellNumericRendererExt : GridCellNumericRenderer { public GridCellNumericRendererExt() { } protected override Syncfusion.UI.Xaml.Controls.Input.SfNumericTextBox OnCreateEditUIElement() { var element = base.OnCreateEditUIElement(); InputScope scope = new InputScope(); InputScopeName name = new InputScopeName(); name.NameValue = InputScopeNameValue.Number; scope.Names.Add(name); element.InputScope = scope; return element; } }
Changing FontSize of SfNumericTextBox
The font size of SfNumericTextBox can be changed by writing style as below,
XAML
<Style TargetType="Syncfusion:SfNumericTextBox"> <Setter Property="FontSize" Value="20"/> </Style>
Samples:
WinRT: CustomizeGridNumericColumn_WRT
UWP: CustomizeGridNumericColumn_UWP