Articles in this section
Category / Section

How to show onscreen keyboard in tablet device while editing a cell in WinForms DataGrid (SfDataGrid)?

1 min read

Show onscreen keyboard

Programmatically launch the on-screen keyboard to open it through SfDataGrid.CurrentCellBeginEdit event when you begin editing in a cell.

C#

this.sfDataGrid.CurrentCellBeginEdit += sfDataGrid1_CurrentCellBeginEdit;
this.sfDataGrid.CurrentCellEndEdit += sfDataGrid1_CurrentCellEndEdit;
 
System.Diagnostics.Process process;
void sfDataGrid1_CurrentCellBeginEdit(object sender, CurrentCellBeginEditEventArgs e)
{
    process = System.Diagnostics.Process.Start("Osk.exe");
}
 
void sfDataGrid1_CurrentCellEndEdit(object sender, CurrentCellEndEditEventArgs e)
{
    if (!process.HasExited)
        process.Kill();
}

VB

AddHandler Me.sfDataGrid.CurrentCellBeginEdit, AddressOf sfDataGrid1_CurrentCellBeginEdit
AddHandler Me.sfDataGrid.CurrentCellEndEdit, AddressOf sfDataGrid1_CurrentCellEndEdit
 
Private process As System.Diagnostics.Process
Private Sub sfDataGrid1_CurrentCellBeginEdit(ByVal sender As Object, ByVal e As CurrentCellBeginEditEventArgs)
    process = System.Diagnostics.Process.Start("Osk.exe")
End Sub
 
Private Sub sfDataGrid1_CurrentCellEndEdit(ByVal sender As Object, ByVal e As CurrentCellEndEditEventArgs)
    If Not process.HasExited Then
       process.Kill()
    End If
End Sub

Sample: https://github.com/SyncfusionExamples/how-to-show-onscreen-keyboard-while-editing-a-cell-in-winforms-datagrid

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