Specify keyboard type on cell edit

Hi, how can I specify which keyboard type I want to display on editing a cell?


1 Reply

NY Nirmalkumar Yuvaraj Syncfusion Team April 10, 2024 06:48 AM UTC

Hi Phunction


You can specify the keyboard type for a particular column type by overriding the renderer. In the OnCreateEditUIView() method, you can obtain the editElement and set its keyboard value to 'numeric' to display the numeric keyboard. We have attached the code snippet and a sample for your reference. I hope this helps! Please let me know if you have any further questions or if there is anything else I can assist you with.


Code snippet:

public partial class MainPage : ContentPage

{

    public MainPage()

    {

        InitializeComponent();

        dataGrid.CellRenderers.Remove("Text");

        dataGrid.CellRenderers.Add("Text", new CustomTextBoxRenderer());

    }

 

}

 

public class CustomTextBoxRenderer : DataGridTextBoxCellRenderer

{

    protected override SfDataGridEntry OnCreateEditUIView()

    {

        var entry = base.OnCreateEditUIView();

        entry.Keyboard = Keyboard.Numeric;

        return entry;

    }

}


If this post is helpful, please consider Accepting it as the solution so that other members can locate it more quickly.


Regards,

Nirmalkumar


Attachment: SfDataGridSample_be6ba369.zip

Loader.
Up arrow icon