Madness, I call it madness

Ask a Question related to ASP.NET Data Grid Control, Design and Development.

  1. #1

    Default Madness, I call it madness

    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 Guest

  2. Similar Questions and Discussions

    1. autostretch madness
      so ive been using DW fora few years and all of a suddenive come across this madness wheni started using DW04, autostretch on the height (100%) code ...
    2. Array MADNESS
      Have I gone crazy? <cfscript> arr=arrayNew(2); arr = 'Col 1 Row 1'; arr = 'Col 1 Row 2'; arr = 'Col 2 Row 1'; arr = 'Col 2 Row 2'; arr = 'Col...
    3. addcamera madness!
      can someone please please explain to me why this gives an "object in handler not found "error when i try and run it with the add camera command...
    4. flv -&gt; swf madness
      i've created a flv from a quicktime movie and exported it out as a swf then i load that swf into a movieclip and everything works fine except that...
    5. Forum madness
      I just set up a php site. When I click the Forum link. the Forum sometimes open perfectly normal Other times is open as scrambled text LIKE THIS,...
  3. #2

    Default Re: Madness, I call it madness

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

    But F5 still won't work.

    MH


    Marius Horak Guest

  4. #3

    Default Re: Madness, I call it madness

    wrong forum, this is about the ASP.NET DataGrid

    "Marius Horak" <someone@europe.eu> wrote in message news:uwpSOniSEHA.3224@TK2MSFTNGP10.phx.gbl...
    > OK, solved the problem with 1,2,4,8,16 ...
    >
    > But F5 still won't work.
    >
    > MH
    >
    >
    Raterus Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139