473,394 Members | 1,506 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,394 software developers and data experts.

DataGrid LostFocus does not seem right

I have a datagrid tied to a data adapter. Everything works great,
EXCEPT, the LostFocus event only fires when I click on a specific cell
within the DataGrid. If I set focus on another control, the LostFocus
event does not fire. This is causing problems because I am checking
for HasChanged on every CurrentCellChanged event.

So if I change a cell, move to a new row, the update occurs just fine.
However, if I change a cell, then set the focus to another control, the
LostFocus event does not fire and I cannot check on whether the cell
was updated or not. Hence, the last change made without moving to a
new row is never saved.

Any help would be greatly appreciated!

Nov 21 '05 #1
2 3168
Paul,

Cells are pushed down to the datasource using the endcurentedit, probably
implementing that will do what you are looking for.

A sample of that
\\\
BindingContext(ds.Tables(0)).EndCurrentEdit()
///

I hope this helps

Cor
Nov 21 '05 #2
Thanks Cor! I don't quite understand your code. However, I did
resolve this by using the Validating event. It fires when the DataGrid
loses focus and has the correct value for the HasChanged.

Thanks again!

Nov 21 '05 #3

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

Similar topics

4
by: MJW | last post by:
Is there a way for me to know if or which command button was just clicked that triggers the LostFocus event for the current control on a Form? I have a form that has many types of users who each...
2
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...
5
by: Steve | last post by:
I have a datagrid in a WinForm. When the user edits an entry in the datagrid, after he leaves that field, I would like to do some cheking. What event fires when the user does that? I need to...
4
by: dudzcom | last post by:
hi, this is the first time i've posted to this board, though i have been a devoted lurker for some time i have been working in vb.net and run into a couple problems that seem to require solutions...
2
by: Sam | last post by:
Hi, I've got two grids on my form. When one loses the focus I do the following: Private inFocusing As Boolean = False Private Sub dgParams_LostFocus(ByVal sender As Object, ByVal e As...
0
by: Scott McChesney | last post by:
All - I am in the process of developing a custom control that mimics the Office 2003 "Inbox" as closely as possible. After a great deal of frustrating work trying to do a heavily custom-drawn...
0
by: Greg | last post by:
I'd like to know which contol the focus of a cell in a datagrid is being lost to. Querying ActiveControl.Name within the LostFocus event gives me a blank string, instead of the name of a button I...
6
by: Carmon | last post by:
I am using Managed C++ with a CFormView and a MaskedTextBox and have used MAKE_DELEGATE to sink the LostFocus event of this control. I have other events I've sinked off this control and they all...
14
by: teddysnips | last post by:
WINDOWS FORMS I've a form that has a textbox that allows the user to enter a string. On the LostFocus event, the textbox formats the string into a preferred format. However, if the user...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
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...

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.