473,779 Members | 1,884 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Capturing events in a DataGrid

I'm trying to add functionality to a VB 6 application allowing
customer service to add a customer number to a new customer.
Customers are added to the database by sales personnel, and a
prospective customer may have multiple rows due to projected orders
for multiple products. Customer numbers are assigned when a new
customer makes their first order.

I'm using a DataGrid connected to an ADO Data Control. The data
control is connected to a view in SQL Server using the 'distinct'
directive (I know it's not updatable) to show only one line per new
customer. What I wish to do is capture the update event (probably
through the FieldChangeComp lete routine of the data control), manually
assign the newly entered customer number to all appropriate rows in
the database, and cancel the update event with no notifications.

I'm having two problems:

1. I can't capture the newly entered customer number. The Text
property of the DataGrid returns the old value of the cell instead of
the newly entered value. How do I get the edited value?

2. Even though I set adStatus = adStatusCancel in the
FieldChangeComp lete routine, I get a Microsoft DataGrid Control dialog
stating 'Operation was Canceled'. How do I avoid this notification?
Jul 20 '05 #1
1 1299
Bill Reynolds (Tr*********@lt ol.com) writes:
I'm trying to add functionality to a VB 6 application allowing
customer service to add a customer number to a new customer.
Customers are added to the database by sales personnel, and a
prospective customer may have multiple rows due to projected orders
for multiple products. Customer numbers are assigned when a new
customer makes their first order.

I'm using a DataGrid connected to an ADO Data Control. The data
control is connected to a view in SQL Server using the 'distinct'
directive (I know it's not updatable) to show only one line per new
customer. What I wish to do is capture the update event (probably
through the FieldChangeComp lete routine of the data control), manually
assign the newly entered customer number to all appropriate rows in
the database, and cancel the update event with no notifications.

I'm having two problems:

1. I can't capture the newly entered customer number. The Text
property of the DataGrid returns the old value of the cell instead of
the newly entered value. How do I get the edited value?

2. Even though I set adStatus = adStatusCancel in the
FieldChangeComp lete routine, I get a Microsoft DataGrid Control dialog
stating 'Operation was Canceled'. How do I avoid this notification?


Sounds like you should ask in an ADO group. Or maybe even a pure VB
group. If you insist on asking here, we will only tell you to use stored
procedures and not relying on things happening behind the scenes. :-)
--
Erland Sommarskog, SQL Server MVP, es****@sommarsk og.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2

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

Similar topics

3
664
by: Bruce HS | last post by:
I do an autopostback from a text box in a datagrid template. How can I capture the event in the code behind? Handles DataGrid1.textboxname.TextChanged doesn't work, and I don't see any DataGrid events appropriate for a textchanged event. Please respond, and save me a $245 support call to MS!
4
12010
by: Jay Xx | last post by:
I have an IFrame in design mode. I've tried a bunch of things to capture key presses in that IFrame, but I can't seem to get it. I can capture key presses outside the IFrame fine. I have this problem in Firefox, not IE. I do know it's possible because Blogger.com's rich text editor does it, but their code is cryptic and separated into like 20 files, so I'm going through hell trying to decipher it. (I need to capture the keypress in order...
7
20372
by: jerrygarciuh | last post by:
Hello, I have been playing with various Googled solutions for capturing the <Enter> key to suppress form submission. My first question is whether anyone has a script that works in all common browsers? The script bellow is IE only. It fails FF 1.0 and NN 7. Also, if I can trap the keypress I would like to use it to tab to the next tabindex.
4
1329
by: JJ | last post by:
Hi, I was wondering is it possible to create my own html table that has two features. 1. it is databound and 2. create my own events for it? The datagrid is nice and I do use it but I need to be able to customize it for other events to occur with it. Thanks,
1
1436
by: Jonah Olsson | last post by:
Hello, I'm trying to build an "add-on" to an already existing custom web user control. The old control collects some user data and saves it to a database. The new control should collect some extra info from the user and add it to a new table in the database. The old control should not be re-written (at least not now..), so I need a way of capturing the click event of the Save button in the old control. This event should trigger a...
5
4746
by: Nick | last post by:
Hey guys, I have 2 events on a windows forms datagrid, the mouse move as well as the double click events. What's happening is that when I double click on a row in the grid, the mouse move event gets triggered and the double click is not identified at all. Is there any way I can invoke the double click when the mouse move also exists?
4
2138
by: Jeff User | last post by:
Hi I tryed to solve this problem over in the framework.asp group, but still am having trouble. Hope someone here can help. using .net 1.1, VS 2003 and C# I have an asp.DataGrid control with a Delete button on the end of each row. I am unable to gain access to the event when the button is clicked. I don't fully understand how the click gets connected to the C# code,
6
1758
by: Steve Hershoff | last post by:
Hi everyone, I've got a strange one here. There are two datagrids on my page, one nested within the other. I'll refer to them as the topmost and secondary datagrids. In the topmost datagrid's OnItemDataBound() method we check for the row in which it's appropriate to add the secondary datagrid. Exactly one row in the topmost grid will contain the secondary grid.
6
4574
by: mbewers1 | last post by:
I've never handled keysroke events before and I would like to implement a Return keystroke event in a Windows form to bring up a list of items in a datagrid as well as habing a search button in the form. With the help of a tutorial, I have coded the following event: private void ReturnResults(object o, KeyPressEventArgs e) { char c = e.KeyChar; if (c == (char) Keys.Return) {
0
9471
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10302
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9925
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7478
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6723
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5372
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4036
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3631
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2867
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.