Madness, I call it madness

Discussion in 'ASP .Net Datagrid Control' started by Marius Horak, Jun 4, 2004.

  1. Marius Horak

    Marius Horak Guest

    Maybe it's me who is mad but...

    I have a windows application with a datagrid.
    On pressing F5 (when the grid or any grid's cell has a focus) I would like
    to refresh data (running my GetGridData procedure).

    I added the KeyDown event to the grid:

    private void MyGrid_KeyDown(object sender, System.Windows.Forms.KeyEventArgs
    e)
    {
    if (e.KeyCode == Keys.F5)
    {
    MessageBox.Show("refresh");
    GetGridData();
    }
    }

    I press F5 and nothing happens. I've changed F5 to F6 and it works - sort
    of. It works only when the focus is on the Header.
    When the focus is on any of the cells - nothing. I've searched the Net and
    I've found the following VB code

    ..........................................................................
    Dim X As Integer
    For X = 2 To DataGrid1.Controls.Count - 1
    AddHandler DataGrid1.Controls(X).KeyPress, AddressOf
    Ctrls_KeyPress
    Next X

    Scot Rose, MCSD
    Microsoft Visual Basic Developer Support
    ..........................................................................

    Converted this to C# and when I press F6 when a cell has a focus the event
    is being executed. Great.
    I press F6 again and now then event would be executed twice.
    Press F6 again and now event is fired 4 times.
    Again - 8 times, again 16 - times.

    Madness!!!

    How to make F5 working within a grid?

    MH
     
    Marius Horak, Jun 4, 2004
    #1
    1. Advertising

  2. Marius Horak

    Marius Horak Guest

    OK, solved the problem with 1,2,4,8,16 ...

    But F5 still won't work.

    MH
     
    Marius Horak, Jun 4, 2004
    #2
    1. Advertising

  3. Marius Horak

    Raterus Guest

    wrong forum, this is about the ASP.NET DataGrid

    "Marius Horak" <> wrote in message news:...
    > OK, solved the problem with 1,2,4,8,16 ...
    >
    > But F5 still won't work.
    >
    > MH
    >
    >
     
    Raterus, Jun 4, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Todd

    Session Variable Madness

    Todd, Jan 21, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    423
  2. V. Jenks

    RadioButtonList madness!

    V. Jenks, Apr 19, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    463
    Ashish M Bhonkiya
    Apr 19, 2004
  3. =?Utf-8?B?QUNhdW50ZXI=?=

    Audio Madness @#!#@

    =?Utf-8?B?QUNhdW50ZXI=?=, Feb 26, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    389
    =?Utf-8?B?QUNhdW50ZXI=?=
    Feb 26, 2005
  4. Mr Newbie

    Session Madness

    Mr Newbie, Nov 12, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    400
    Kevin Spencer
    Nov 13, 2005
  5. =?ISO-8859-1?Q?St=E9phane_St-Pierre?=

    KeyStroke madness

    =?ISO-8859-1?Q?St=E9phane_St-Pierre?=, Sep 19, 2003, in forum: Java
    Replies:
    1
    Views:
    376
    Gerbrand van Dieijen
    Sep 20, 2003
Loading...

Share This Page