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

DataSet.HasChanges and Textbox.TextChanged Event

I have been banging my head against this one and I'm sure I'm missing
something:

Got a WinForms app in VB.NET with controls bound to a dataset. For the sake
of this discussion, let's use just one text box control. When the user makes
changes, the first character change in the text box will not set the
underlying DataSet.HasChanges to true. Only the subsequent character change
sets the DataSet.HasChanges to true. Why is that?

More importantly, here is what I need to do:

I need to give the user visual feedback that the record in the dataset is
'dirty' as soon as the user makes the first change. More importantly, if the
user changes only ONE single character, the DataSet.HasChanges needs to be
true so that the rest of my verification and validation code works and I can
prompt the user to save if there are changes that have to be yet written back
to the database table.

How can I do that?

Thanks,

JB
Jul 21 '05 #1
2 3776
JBSound,

First what you tell seems to me impossible.

Data is pushed in the dataset by a change of the current row.

That is why when by instance a button acts as the start for an update, the
first thing that must be done is an endcurrentedit.

So when you want to do what you want, you need something as do everytime
when there is a value change in your textbox an encurrentedit.

I am afraid that your user will not be happy because of the strange effect
it probably has.( I did not thest it).

I hope this helps something.

Cor
Jul 21 '05 #2
Thanks for your time responding. However, I disagree with you on your
assessment that this is not possible. I have this working with some issues
that still need to be addressed.

To further clarify:

I use the TextChanged event of the text box to see if the dataset has
changes. However, as I have found out in the mean time, that's not
necessarily the place to check, or at least not with the EndCurrentEdit
method of the BindingContext for the dataset. Problem there is that
TextChanged happens before the dataset gets updated. So I have to find
another way of pulling this off.

The other aspect of that is that if a TextChange event occurred, the dataset
would already be different, unless that change is cancelled.

Thanks for your attempt to help!

JB

"Cor Ligthert" wrote:
JBSound,

First what you tell seems to me impossible.

Data is pushed in the dataset by a change of the current row.

That is why when by instance a button acts as the start for an update, the
first thing that must be done is an endcurrentedit.

So when you want to do what you want, you need something as do everytime
when there is a value change in your textbox an encurrentedit.

I am afraid that your user will not be happy because of the strange effect
it probably has.( I did not thest it).

I hope this helps something.

Cor

Jul 21 '05 #3

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

Similar topics

1
by: David Smith | last post by:
What I want to be able to do: A textbox is available that the user can enter information into. Specifically (for the purposes of this post), the user is asked to enter a number, and that number...
2
by: Alpha | last post by:
Hi, I have a window based program. One of the form has several textboxes and a datagrid. The textboxes are bind to the same dataset table as the datagrid and the text changes to reflect different...
3
by: Alpha | last post by:
Hi, I have a window C# application. I update the dataset when user finished entering in a text box. But when I want to update the database when OK is pressed, the...
5
by: Vi | last post by:
Hello, I want to be able to reload a DropDownList when a TextBox changes its value. So I set the AutopostBack property of the TextBox to true and in the code behind I do something like: ...
4
by: MattB | last post by:
Hi. I'm working on an intranet application that requires a user to input information about themselves. I have a user control with a couple of textboxes that I want the user to enter their weight...
3
by: DotNetNewbie | last post by:
I am reading the book Teach Yourself Microsoft Visual Basic .Net 2003 in 21 Days. I am having trouble getting one of the exercises to work at the end of day 4. Exercises: 1. Create a new...
2
by: jbsound | last post by:
I have been banging my head against this one and I'm sure I'm missing something: Got a WinForms app in VB.NET with controls bound to a dataset. For the sake of this discussion, let's use just...
4
by: Jason Huang | last post by:
Hi, In my C# Windows form MyForm I have some TextBoxes. In these TextBoxes, we have to detect if the TextChanged event occurs, if there're changes in these TextBoxes, it will ask if we want to...
1
by: Peter Newman | last post by:
I have a problem i donr seem to be able to find a soloution to i have created a dataset, binded the controls to it, set primary keys managed to set up navigation through the table and even...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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,...
1
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...
0
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...
0
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...

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.