Articles in this section
Category / Section

How to change the columns FontSize and InputScope in UWP DataGrid?

2 mins 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

 

 

Conclusion

I hope you enjoyed learning about how to change the columns FontSize and InputScope in UWP DataGrid.

You can refer to our UWP DataGrid feature tour page to know about its other groundbreaking feature representations. You can also explore our UWP DataGrid documentation to understand how to create and manipulate data.

For current customers, you can check out our components from the License and Downloads page. If you are new to Syncfusion, you can try our 30-day free trial to check out our other controls.

If you have any queries or require clarifications, please let us know in the comments section below. You can also contact us through our support forumsDirect-Trac, or feedback portal. We are always happy to assist you!

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