473,405 Members | 2,373 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,405 software developers and data experts.

DataGridView - IsCurrentRowDirty

Using VB.NET 2005, Windows Form and I bind a DataGridView to a table

dgvFees.DataSource = tbl
I make some changes to the cells in the grid and when I leave the grid, I
run the following code:

For Each DR As DataGridViewRow In Me.dgvFees.Rows
If dgvFees.IsCurrentRowDirty = True Then
ChangesDone = True
Else
ChangesDone = False
End If
Next

Sometimes it works and sometimes it doesn't. I can't pinpoint why it does.
I have debugged and there is no rhyme or reason as to why it isn't always
true when changes are made.

If anyone could give me some pointers, I would appreciate it.

Thank you.
May 23 '07 #1
3 6800
Bill,

Ever watched where the cursor is as you run your test. In other words, did
it leave the tested field after the change or not?

Cor

"Bill Yanaire" <bi**@yanaire.comschreef in bericht
news:ez**************@TK2MSFTNGP06.phx.gbl...
Using VB.NET 2005, Windows Form and I bind a DataGridView to a table

dgvFees.DataSource = tbl
I make some changes to the cells in the grid and when I leave the grid, I
run the following code:

For Each DR As DataGridViewRow In Me.dgvFees.Rows
If dgvFees.IsCurrentRowDirty = True Then
ChangesDone = True
Else
ChangesDone = False
End If
Next

Sometimes it works and sometimes it doesn't. I can't pinpoint why it
does. I have debugged and there is no rhyme or reason as to why it isn't
always true when changes are made.

If anyone could give me some pointers, I would appreciate it.

Thank you.


May 24 '07 #2
Yes, I made changes to some cells and then clicked on another control, the
code I posted ran. It just doesn't set the IsCurrentRowDirty to true. I
did step through the loop for each record and it was always false.
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:uF****************@TK2MSFTNGP06.phx.gbl...
Bill,

Ever watched where the cursor is as you run your test. In other words, did
it leave the tested field after the change or not?

Cor

"Bill Yanaire" <bi**@yanaire.comschreef in bericht
news:ez**************@TK2MSFTNGP06.phx.gbl...
>Using VB.NET 2005, Windows Form and I bind a DataGridView to a table

dgvFees.DataSource = tbl
I make some changes to the cells in the grid and when I leave the grid, I
run the following code:

For Each DR As DataGridViewRow In Me.dgvFees.Rows
If dgvFees.IsCurrentRowDirty = True Then
ChangesDone = True
Else
ChangesDone = False
End If
Next

Sometimes it works and sometimes it doesn't. I can't pinpoint why it
does. I have debugged and there is no rhyme or reason as to why it isn't
always true when changes are made.

If anyone could give me some pointers, I would appreciate it.

Thank you.



May 24 '07 #3
Bill,

The isDirty is a strange kind of property in dotNet (it is more used by Java
and Unix AFAIK), we mostly use Haschanges on the datasource.

Cor

"Bill Yanaire" <bi**@yanaire.comschreef in bericht
news:OO**************@TK2MSFTNGP04.phx.gbl...
Yes, I made changes to some cells and then clicked on another control, the
code I posted ran. It just doesn't set the IsCurrentRowDirty to true. I
did step through the loop for each record and it was always false.
"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:uF****************@TK2MSFTNGP06.phx.gbl...
>Bill,

Ever watched where the cursor is as you run your test. In other words,
did it leave the tested field after the change or not?

Cor

"Bill Yanaire" <bi**@yanaire.comschreef in bericht
news:ez**************@TK2MSFTNGP06.phx.gbl...
>>Using VB.NET 2005, Windows Form and I bind a DataGridView to a table

dgvFees.DataSource = tbl
I make some changes to the cells in the grid and when I leave the grid,
I run the following code:

For Each DR As DataGridViewRow In Me.dgvFees.Rows
If dgvFees.IsCurrentRowDirty = True Then
ChangesDone = True
Else
ChangesDone = False
End If
Next

Sometimes it works and sometimes it doesn't. I can't pinpoint why it
does. I have debugged and there is no rhyme or reason as to why it isn't
always true when changes are made.

If anyone could give me some pointers, I would appreciate it.

Thank you.




May 24 '07 #4

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

Similar topics

10
by: Henok Girma | last post by:
Hello Gurus, I want to save the state of an unbound DataGridView on my Windows Form application to an XML file so i can later load it back.. Basically, on my form I have a DataGridView, it's got...
3
by: Rich | last post by:
Hello, I am populating a datagridview from a datatable and filtering the number of rows with a dataview object. Is there a way to retrieve the rows displayed by the datagridview into a separate...
7
by: Mitchell S. Honnert | last post by:
Is there an equivalent of the DataGrid's DataGridTableStyle for the DataGridView? If not, is there an easy way to duplicate the DataGridTableStyle's functionality for the DataGridView? Here's...
4
by: Terry Olsen | last post by:
How can i tell if a row in my DataGridView has been edited? I'm loading a DataTable with ID3 information from MP3 files and using that as the datasource for the DataGridView. I'm letting the user...
7
by: =?Utf-8?B?TG9zdEluTUQ=?= | last post by:
Hi All :) I'm converting VB6 using True DBGrid Pro 8.0 to VB2005 using DataGridView. True DBGrid has a MultipleLines property that controls whether individual records span multiple lines. Is...
0
by: =?Utf-8?B?aW1yYW4uYQ==?= | last post by:
Hi all, I am having a problem with inserting rows in to my datagridview control. The datagridview is bound to a bindingsource with a filter set. If i try and add a row to the datagridview while...
0
by: jeastman - Hotmail | last post by:
Hello world Excuse, not to be written English and it helps me with a translator. I am new programming in C#. I made a control inheriting the DataGridView to be able to add controls done by...
2
by: jogisarge | last post by:
Hi @all, ich have a datatable added to a dataset. the dataset is binded to a datagridview. How can i get all modified rows from the dataset ? I have to check all the modified rows in a...
3
by: Andrus | last post by:
I have DataGridView in virtual mode containing 3500 rows. In code below, assigning to RowCount value to 3500 takes 8 seconds. CPU usage goes high at this time. Stepping by F11 into user code shows...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...
0
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...
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
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...

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.