Hi Diego,
Thank you for contacting Syncfusion support.
We have analyzed your query and you can achieve this, you need to deriveanew class fromtheGridCellNumericRenderer and overridetheOnInitializeEditElementmethod. Within this method you can the maximum length with help of SfNumericTextBox.MaxLength property. Please refer the below code example.
using Syncfusion.UI.Xaml.ScrollAxis; using Syncfusion.UI.Xaml.Controls.Input; public sealed partial class MainPage : Page { public MainPage() { this.InitializeComponent(); this.sfDataGrid.CellRenderers.Remove("Numeric"); this.sfDataGrid.CellRenderers.Add("Numeric", new GridCellNumericRendererExt()); } } public class GridCellNumericRendererExt : GridCellNumericRenderer { public override void OnInitializeEditElement(RowColumnIndex rowColumnIndex, SfNumericTextBox uiElement, GridColumn column, object dataContext) { uiElement.MaxLength = 5; base.OnInitializeEditElement(rowColumnIndex, uiElement, column, dataContext); } } |
Also, you can achieve this by writing style to SfNumericTextBox and set value to MaxLength property within this style because we have load SfNumericTextBox in GridNumericColumn editing mode. Please refer the below code snippet.
xmlns:editors="using:Syncfusion.UI.Xaml.Controls.Input" <Page.Resources> <Style TargetType="editors:SfNumericTextBox"> <Setter Property="MaxLength" Value="5"/> </Style> </Page.Resources> |
Please let us know if you require further assistance.
Thanks,
Ashok
Hi Vasanth,
Thank you for your update.
We have analyzed your query and we are able to reproduce the reported “Esc Key does not reset the old value for indexer property when applying the validation” issue. We have updated the details in incident #138209, please refer this incident.
Please let us know if you require further assistance.
Thanks,
Ashok