Re: issue with overriding ProcessCmdKey() in DataGrid
- From: "Bruce Barker" <brubar_nospamplease_@xxxxxxxxxx>
- Date: Wed, 22 Jun 2005 13:45:31 -0700
in the web version of the grid, the keystrokes happen on the client unknown
to the server, so this methods don't exist. what you want done has to be
done with client script. any javascript book will give enough info to do
this.
-- bruce (sqlwork.com)
"jibran" <jibran@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:A1B7977A-DF4B-40B2-813F-0A163848CB10@xxxxxxxxxxxxxxxx
> 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 :^).
>
.
- Follow-Ups:
- References:
- issue with overriding ProcessCmdKey() in DataGrid
- From: jibran
- issue with overriding ProcessCmdKey() in DataGrid
- Prev by Date: uploading xml
- Next by Date: how are asp 3.0 and asp.net different/similar?
- Previous by thread: issue with overriding ProcessCmdKey() in DataGrid
- Next by thread: Re: issue with overriding ProcessCmdKey() in DataGrid
- Index(es):
Relevant Pages
|