How can i catch the tab key in KeyDown event of Grid control

Any idea? I try all combination of WantKeys and WantTabKey but still have no luck.

2 Replies

AD Administrator Syncfusion Team October 13, 2005 01:04 PM UTC

To catch the tab key, you can derive teh grid and override ProcessCmdKey.
public class MyGridDataBoundGrid : GridDataBoundGrid
{
	protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
	{
		if(keyData == Keys.Tab)
		{
			//tab key pressed		}
		return base.ProcessCmdKey (ref msg, keyData);
	}
}


JO Joshua October 13, 2005 01:22 PM UTC

Thanks >To catch the tab key, you can derive teh grid and override ProcessCmdKey. >
>public class MyGridDataBoundGrid : GridDataBoundGrid
>{
>	protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
>	{
>		if(keyData == Keys.Tab)
>		{
>			//tab key pressed		}
>		return base.ProcessCmdKey (ref msg, keyData);
>	}
>}
>

Loader.
Up arrow icon