Skip to content

SyncfusionExamples/How-to-suspend-the-PING-sound-when-perform-the-Tab-operation-in-DataGrid-SfDataGrid-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

How to suspend the PING sound when perform the Tab operation in DataGrid(SfDataGrid)?

About the sample

This example illustrates how to suspend the PING sound when perform the Tab operation in DataGrid(SfDataGrid)?

SfDataGrid doesn’t have direct support to disable this sound, which occurs when pressing Tab key on the TextBox. It is the behavior of the default TextBox. However, you can disable this by enabling the SuppressKeyPress property within the KeyDown event of the TextBox. In SfDataGrid cells this can be achieved by creating custom renderer.

this.sfDataGrid.CellRenderers["TextBox"] = new GridTextBoxCellRendererExt(); 
 
class GridTextBoxCellRendererExt : GridTextBoxCellRenderer 
{ 
    protected override void OnInitializeEditElement(DataColumnBase column, Syncfusion.WinForms.GridCommon.ScrollAxis.RowColumnIndex rowColumnIndex, TextBox uiElement) 
    { 
        base.OnInitializeEditElement(column, rowColumnIndex, uiElement); 
        uiElement.KeyDown += uiElement_KeyDown; 
    } 
 
    protected override void OnUnwireEditUIElement(TextBox uiElement) 
    { 
        base.OnUnwireEditUIElement(uiElement); 
        uiElement.KeyDown -= uiElement_KeyDown; 
    } 
 
    void uiElement_KeyDown(object sender, KeyEventArgs e) 
    { 
        if (e.KeyCode == Keys.Tab) 
            e.SuppressKeyPress = true; 
    } 
} 

Requirements to run the demo

Visual Studio 2015 and above versions

About

How to suspend the PING sound when perform the Tab operation in DataGrid(SfDataGrid)?

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages