Articles in this section
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

 

 

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied