Re: issue with overriding ProcessCmdKey() in DataGrid



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 :^).
>


.



Relevant Pages

  • ComboBox in DataGrid,
    ... in this case I need to override its original behaviours. ... /// Implementation of a ComboBox as a column in a DataGrid ... private ComboBox internalComboBox = new ComboBox; ... private int rowNum = -1; ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Keyboard Selection of DataGrid Rows then Delete
    ... Here is an derived datagrid using a ProcessCmdKey override. ... > but they should be able to use the delete ley when editing the cell. ...
    (microsoft.public.dotnet.framework.windowsforms)
  • issue with overriding ProcessCmdKey() in DataGrid
    ... I have wrapped the DataGrid control with my own class (SmartDataGrid) ... any editable textbox calls my inital search function that populates my first ... All the documentation I've come across tells me to override the ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Changing the Cursor on a DataGrid Cell
    ... One way you can do this is to derive the datagrid and handle the ... WM_SETCURSOR message yourself in a WndProc override. ... Public Class MyDataGrid ... however I'm not sure what object to change the cursor on. ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: Change mouse cursor when points to specific cell
    ... Try subclassing the DataGrid and override OnMouseEnter method. ... is of Type LinkLabelColumn then change the cursor style. ... for the Look a like linkLabel in my inherited DataGrid. ...
    (microsoft.public.dotnet.framework.windowsforms)