473,327 Members | 2,007 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Enter key in datagrid

Hi there,
I know this is probably a 101-type question, and I've dealt with it using
client script blocks before, but I'm curious about what the best way to
handle the enter key is.. (i.e., to handle it when it generates a postback).

In my particularly frustrating situation, I have a master-detail type
datagrid/form page, and when the user hits the enter key, the form is
submitted and the first record in the master grid gets deleted. I'm assuming
this is because the enter key is submitting the form and what, assuming a
'Delete' command name or something? The only way a record can get deleted is
by using my 'ondeletecommand' event handler.. My datagrid has four columns,
the first being a linkcommand with an 'edit' command name, the second and
third are simple labels, and the fourth is an image button with a 'delete'
command name.

Does anyone have any advice, not necessarily for the particular nuance of my
problem, but just in general, how to handle the enter key? I've seen some
examples on the web with people building their own datagrid controls that
inherit from the datagrid, adding functionality to handle the enter key, but
this is a bit much for what I'm trying to do. Surely there's a better way to
handle the enter key than building a new control..?

Any ideas?

Thanks,
S
Nov 18 '05 #1
1 1229
Hi Stephen,

I have viewed that this post has been posted in several groups. I have
added a reply to you in
microsoft.public.dotnet.framework.aspnet.datagridc ontrol, please follow up
there. I will help you.

Thanks for your understanding.

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ali Eghtebas | last post by:
Hi, I have 3 questions regarding the code below: 1) Why can't I trap the KEYDOWN while I can trap KEYUP? 2) Is it correct that I use Return True within the IF-Statement? (I've already read...
1
by: Byron McClain | last post by:
.... is being consumed. I added an event handler for the "keypress" event and my delegate never gets executed. Why? I am trying to catch the "enter" key pressed event to prevent the DataGrid...
3
by: Mike L | last post by:
For a Data Grid in a Win Form, when the user selects a row and then presses the Enter key, how do I capture that the user pressed the enter key?
1
by: Andrea Williams | last post by:
I've created a simple search form and a submit button. On click of the button, I have code-behind that runs and fills a datagrid. However, it the person is focused on one of the other controls...
3
by: Melson | last post by:
hi can anyone help me how can i capture ENTER keystroke when the cell in datagrid is in editing mode. I'm now creating a data entry form with primary key in header and details in datagrid. So...
1
by: Simon | last post by:
Hi all... I've got an editable datagrid in my application. Clicking "edit" enables those fields to be editted, and then clicking Update triggers my code to do the update on the database. I...
4
by: Newbie | last post by:
Hi Everyone, ASP.NET 1.x I have a problemette ! I have a datagrid on my web form. When the user hits the enter key whilst any editable field on the form including those in the datagrid...
2
by: Newbie | last post by:
Hi Everyone, ASP.NET 1.x I have a problemette ! I have a datagrid on my web form. When the user hits the enter key whilst any editable field on the form including those in the datagrid...
2
by: benfly08 | last post by:
Hi, everyone. I got a weird problem for my C# program. In my program, I use a DataGrid to display data. I bind the DataGrid to a DataTable. I made all the cells in DataGrid ReadOnly as True. So...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.