Hello. I have wrapped the DataGrid control with my own class (SmartDataGrid)
adding some necessary functionality. My current webform has 2
SmartDataGrids. The first is populated by selected information from a drop
down box. The second datagrid is populated by viewing details from a row of
the first datagrid.
When editing individual rows (in either datagrid), clicking the enter key in
any editable textbox calls my inital search function that populates my first
datagrid. I want the enter key to tab to the next location. yes, simple!
All the documentation I've come across tells me to override the
ProcessCmdKey(). So I did just that. Here is my code...
public class SmartDataGrid : System.Web.UI.WebControls.DataGrid
{
override protected bool ProcessCmdKey(ref System.Windows.Forms.Message msg,
System.Windows.Forms.Keys keyData)
{
if(msg.WParam.ToInt32() == (int) Keys.Enter)
{
SendKeys.Send("{Tab}");
return true;
}
return base.ProcessCmdKey(ref msg, keyData);
}
}
The error i'm getting is "no suitable method found to override". I have
found this article (HOW TO: Trap Keystrokes:
http://support.microsoft.com/kb/320584/EN-US/) in the KB and the one HUGE
difference is that their example overrides the
"System.Windows.Forms.DataGrid". I'm overriding the
"System.Web.UI.WebControls.DataGrid". If i change from one to the other then
i have 3 different overrides that give me the same error (the ProcessCmdKey
acutally compiles in this case).
I've run out of ideaRs..........
thanks for your help in advance...
--
jibran :^).