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

ADO RowState problem

BK
I'm going nuts here trying to figure this out. In a winform, I have a
datagrid bound to a dataset. I want to perform some database updates
when the user edits certain fields of data. Consider the following
code:

If
Me.DsEventLineItemsView.Tables(0).Rows(Me.LastCell .RowNumber).RowState
= DataRowState.Modified Then
..... code here to handle the updated information
End If

My problem is that this only works when the user moves off the datagrid
line. If the user changes a column and DOES NOT move off the line, the
DataRowState is Unchanged. That REALLY SUCKS. What am I missing here?
How can I detect a change WITHOUT the user moving off the line? There
are times when the datagrid only has 1 record in it. These
calculations are lengthy and we don't want to perform them unless the
user has truly changed something. Any help is appreciated.

Bill

Mar 21 '06 #1
3 1041
Perhaps you could use the DataGrid's CurrentCellChanged event.
This would only fire if the user changes something.
So you don't need to do a state check on your row.
You already know once that event is handled that the current cell has
indeed changed and needs calculations.

Mar 22 '06 #2
BK,

Will you please be so kind not to multipost, I have given an answer in
another newsgroup on this question. Crossposting is no problem which is
sending one message to more newsgroups.

Cor

"BK" <bk******@hotmail.com> schreef in bericht
news:11**********************@u72g2000cwu.googlegr oups.com...
I'm going nuts here trying to figure this out. In a winform, I have a
datagrid bound to a dataset. I want to perform some database updates
when the user edits certain fields of data. Consider the following
code:

If
Me.DsEventLineItemsView.Tables(0).Rows(Me.LastCell .RowNumber).RowState
= DataRowState.Modified Then
.... code here to handle the updated information
End If

My problem is that this only works when the user moves off the datagrid
line. If the user changes a column and DOES NOT move off the line, the
DataRowState is Unchanged. That REALLY SUCKS. What am I missing here?
How can I detect a change WITHOUT the user moving off the line? There
are times when the datagrid only has 1 record in it. These
calculations are lengthy and we don't want to perform them unless the
user has truly changed something. Any help is appreciated.

Bill

Mar 22 '06 #3
BK
Thanks for the reply. I am using the DataGrid's CurrentCellChanged
event. That event fires anytime the user moves from cell to cell,
regardless of wheter they've changed anything. What I need is an event
that truly signals if a cell has changed. Any other thoughts?

BTW, I'm sorry about posting to 2 newsgroups, I didn't realize that was
improper netiquette.

Mar 22 '06 #4

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

Similar topics

4
by: Bill Todd | last post by:
Is there any way to display the RowState of each row in a computed column in the DataTable? -- Bill
2
by: certolnut | last post by:
Hi all I'm using the "Merge" method for datasets to append data from an external excel spreadsheet into a Sql Server Table The problem is that "Merge" method copies over the current RowState...
6
by: astro | last post by:
I'm working through the binder stuff trying to get a handle on it... I have setup a master-detail dataset and have a couple of textboxes from the master along with a datadgrid for the child data....
1
by: Sam | last post by:
Hi, I have to face a tricky problem and I thought someone could help. I have a grid bound to a dataset and as soon as a row is selected one of the column is udpated according to the value in...
6
by: timbobd | last post by:
I have a Windows form that displays a database table in a DataGrid. When you click on a row, the row's values get copied to bound TextBoxes below, and when the "Save" button is clicked the database...
0
by: Jarod | last post by:
Hey I have GridViewEventArgs e. And this e.Row.RowState returns current state. I woudl like to check if e.Row.Rowstate == ...Edit; But the problem is sometimes Rowstate is something like this :...
0
by: vbie | last post by:
I have a function that evaluates whether the current rowstate of a datatable is ADDED. If RowState is Added then an INSERT sql command is executed; if not then an UPDATE sql command is performed. ...
13
by: Dale Harris | last post by:
I'm getting really strange behaviour where the data source RowState is not being updated to modified in some circumstances. I place my controls on a form, bind them through a BindingSource control...
3
by: perspolis | last post by:
Hi all I have a master detail table which I use them in Transaction to Update them. in some cases the detail table generates error and I Rollback transaction but RowState of master table dosen't...
2
by: Gurny | last post by:
I have a DataSet I am loading via the DataSet.Tables.Add() method. I call the AcceptChanges method on the DataTable first thing. Every thing looks good i.e. RowStates are all Unchanged. I then...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
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...

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.