Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Madness, I call it madness

Reply
Thread Tools

Madness, I call it madness

 
 
Marius Horak
Guest
Posts: n/a
 
      06-04-2004
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


 
Reply With Quote
 
 
 
 
Marius Horak
Guest
Posts: n/a
 
      06-04-2004
OK, solved the problem with 1,2,4,8,16 ...

But F5 still won't work.

MH


 
Reply With Quote
 
 
 
 
Raterus
Guest
Posts: n/a
 
      06-04-2004
wrong forum, this is about the ASP.NET DataGrid

"Marius Horak" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
> OK, solved the problem with 1,2,4,8,16 ...
>
> But F5 still won't work.
>
> MH
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
OT: Monday Madness FrisbeeŽ MCSE 31 12-14-2005 07:57 PM
OT: Monday Madness FrisbeeŽ MCSE 50 08-18-2005 03:31 AM
OT: More Monday Madness Briscobar MCSE 2 08-16-2005 07:49 PM
OT: Monday Madness =?iso-8859-1?Q?Frisbee=AE?= MCSE 15 03-22-2005 06:47 PM
Cisco PIX 501 madness ... help stevo321 Cisco 5 04-11-2004 10:02 AM



Advertisments