473,549 Members | 2,247 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DataGrid, Edit and the Enter Key

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 itself, it
triggers a submit back to the server.

A the least, I want to disable this and at best, I want to know if I can
trap the enter key for the currently being edited row on the datagrid to
force and update event of that line.

Can anyone help ?


Jan 13 '06 #1
4 1762
Newbie,

I have a javascript component on my website and one of the scripts is used
to trap the enter key while in a textbox and click the button of your
choice. It will be a bit more difficult to do in a datagrid since you'll
have to use the OnItemDatabound event to hook up the script properly. The
component is free and comes with all source code. For your use I would
suggest stripping out just the code you need and using it as an example.
Also in my code library if you do a search for "Clickable Datagrid" I have
an example of how to make a datagrid row clickable for selecting it. You
won't need that, but it does show how to hook up a javascript to the
datagrid's select button from within OnItemDatabound . That example should be
helpful for doing this. You may find a demo and link to download the
javascript component here: http://www.aboutfortunate.com?page=javascriptdemo
--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Newbie" <me@me.com> wrote in message
news:Ob******** ********@tk2msf tngp13.phx.gbl. ..
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 itself, it
triggers a submit back to the server.

A the least, I want to disable this and at best, I want to know if I can
trap the enter key for the currently being edited row on the datagrid to
force and update event of that line.

Can anyone help ?


Jan 13 '06 #2
Thanks a lot Justin, I will have a go at this next Monday when Im back at
work
"S. Justin Gengo [MCP]" <justin@[no_spam_please]aboutfortunate. com> wrote in
message news:OZ******** ******@TK2MSFTN GP14.phx.gbl...
Newbie,

I have a javascript component on my website and one of the scripts is used
to trap the enter key while in a textbox and click the button of your
choice. It will be a bit more difficult to do in a datagrid since you'll
have to use the OnItemDatabound event to hook up the script properly. The
component is free and comes with all source code. For your use I would
suggest stripping out just the code you need and using it as an example.
Also in my code library if you do a search for "Clickable Datagrid" I have
an example of how to make a datagrid row clickable for selecting it. You
won't need that, but it does show how to hook up a javascript to the
datagrid's select button from within OnItemDatabound . That example should
be helpful for doing this. You may find a demo and link to download the
javascript component here:
http://www.aboutfortunate.com?page=javascriptdemo
--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Newbie" <me@me.com> wrote in message
news:Ob******** ********@tk2msf tngp13.phx.gbl. ..
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 itself, it
triggers a submit back to the server.

A the least, I want to disable this and at best, I want to know if I can
trap the enter key for the currently being edited row on the datagrid to
force and update event of that line.

Can anyone help ?



Jan 13 '06 #3
Newbie,

If you have any questions feel free to email me.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Newbie" <me@me.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Thanks a lot Justin, I will have a go at this next Monday when Im back at
work
"S. Justin Gengo [MCP]" <justin@[no_spam_please]aboutfortunate. com> wrote
in message news:OZ******** ******@TK2MSFTN GP14.phx.gbl...
Newbie,

I have a javascript component on my website and one of the scripts is
used to trap the enter key while in a textbox and click the button of
your choice. It will be a bit more difficult to do in a datagrid since
you'll have to use the OnItemDatabound event to hook up the script
properly. The component is free and comes with all source code. For your
use I would suggest stripping out just the code you need and using it as
an example. Also in my code library if you do a search for "Clickable
Datagrid" I have an example of how to make a datagrid row clickable for
selecting it. You won't need that, but it does show how to hook up a
javascript to the datagrid's select button from within OnItemDatabound .
That example should be helpful for doing this. You may find a demo and
link to download the javascript component here:
http://www.aboutfortunate.com?page=javascriptdemo
--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Newbie" <me@me.com> wrote in message
news:Ob******** ********@tk2msf tngp13.phx.gbl. ..
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
itself, it triggers a submit back to the server.

A the least, I want to disable this and at best, I want to know if I can
trap the enter key for the currently being edited row on the datagrid to
force and update event of that line.

Can anyone help ?




Jan 13 '06 #4
I have a different question regarding user controls which I have just posted
to the group, if you wouldnt mind taking a look at that I would appriciate
it.

Thanks
"S. Justin Gengo [MCP]" <justin@[no_spam_please]aboutfortunate. com> wrote in
message news:eD******** ******@tk2msftn gp13.phx.gbl...
Newbie,

If you have any questions feel free to email me.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Newbie" <me@me.com> wrote in message
news:%2******** ********@TK2MSF TNGP09.phx.gbl. ..
Thanks a lot Justin, I will have a go at this next Monday when Im back at
work
"S. Justin Gengo [MCP]" <justin@[no_spam_please]aboutfortunate. com> wrote
in message news:OZ******** ******@TK2MSFTN GP14.phx.gbl...
Newbie,

I have a javascript component on my website and one of the scripts is
used to trap the enter key while in a textbox and click the button of
your choice. It will be a bit more difficult to do in a datagrid since
you'll have to use the OnItemDatabound event to hook up the script
properly. The component is free and comes with all source code. For your
use I would suggest stripping out just the code you need and using it as
an example. Also in my code library if you do a search for "Clickable
Datagrid" I have an example of how to make a datagrid row clickable for
selecting it. You won't need that, but it does show how to hook up a
javascript to the datagrid's select button from within OnItemDatabound .
That example should be helpful for doing this. You may find a demo and
link to download the javascript component here:
http://www.aboutfortunate.com?page=javascriptdemo
--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Newbie" <me@me.com> wrote in message
news:Ob******** ********@tk2msf tngp13.phx.gbl. ..
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
itself, it triggers a submit back to the server.

A the least, I want to disable this and at best, I want to know if I
can trap the enter key for the currently being edited row on the
datagrid to force and update event of that line.

Can anyone help ?





Jan 16 '06 #5

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

Similar topics

0
2421
by: lu | last post by:
I have a page with datagrid (for viewing, delete,edit,update) and text fields with button to add info to database. When user comes to page the datagrid selects info from database, binds in columns, and adds a delete buttoncolumn and editcommandcolumn. Below that, I have several text boxes with a button with an onclick event to add new...
2
4324
by: pei_world | last post by:
I want to implement a key hit with enter to dropdown a combobox that is in the datagrid. in this case I need to override its original behaviours. I found some codes from the web. Does anyone know how to use this code? please help! http://www.experts-exchange.com/Programming/Programming_Languages/C_Sharp/Q_20862953.html
4
1661
by: Jim Heavey | last post by:
Suppose I am using a series of controls in the footer of a datagrid which allows a user to enter "a new row of information to be added to the datagrid datasource". Some of these controls have a "RequiredValidator" control. I am able to enter data and all is well. On this same datagrid I have a "EditCommand" column which get the user int...
1
1338
by: mike parr | last post by:
I'm trying to build a datagrid similar to one found in shopping carts. I need to have a couple of columns taken from a database query, 1 couple where the user can enter a value in a text box(not edit a value, just enter a value), and a button to confirm the action for that row and update my database. Since I'm not doing an edit, but a...
1
1225
by: MrMike | last post by:
I have a sub named Bind("") which binds my a datagrid on my webform. In order to enter edit mode and edit records on this datagrid, I must make a call to Bind("") either before or after I place the DataGrid into edit mode. For example, DataGrid.EditCommand looks like this ... DataGrid1.EditItemIndex = e.Item.ItemIndex Bind("") Without...
4
10487
by: Melson | last post by:
Hi I've a problem. Can anyone help. I would like to use datagrid for data entry. How can I set the number of rows in the datagrid. And use the datagrid to update the ms sql table. regards melson
0
1744
by: Erik | last post by:
Why isn't my update method getting called? Pasted below is an aspx from a 1.1 application I'm working on. It has two textboxes and a button for inserting data into the database, and a datagrid for editing and deleting data. When a user clicks on the "Edit" button in the datagrid, Edit() method is called and the appropriate row is changed...
7
3200
by: julian.tklim | last post by:
Hi, I need to build an editable Datagrid with add & delete buttons on each row using javascript. DataGrid need not be pre-populated with values. To make the thing complicated, one of the column need to be a date picker field. I know things will be easier with ASPX datagrid.
9
2710
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the code: <script runat="server"> Dim sqlConn As New SqlConnection(".....") Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs) If Not...
23
1923
by: tanya2001 | last post by:
hi all.. I am trying to update my datagrid in my webform...but its not getting updated..though in the database it removing the <null> and inserting a blank field....its not taking the input which m typing...can sombody plz help me out in this..i need help urgently I am posting the code in vb.net for the webform as well as html Protected Sub...
0
7472
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7743
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7986
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7504
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7832
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6074
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5391
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3499
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
786
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.