TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
s_manishkumar
NA
9
0
How to get modified rows from a datagrid , when the changes are made on the editable datagrid itself
Jun 17 2004 3:36 PM
I have a datagrid bound to a datatable , which has customized table style. I display the editable datagrid. I modify some rows ( say row 1, 5 and 6 ) on the datagrid from the interface. Now I would like to get this set of modified rows in the program. Somehow followoing methods are not working for me ? Method : 1 (objDRow.RowState = DataRowState.Modified) Dim objDRow As DataRow For Each objDRow In MyDataSet.Tables("MyTable").Rows If (objDRow.RowState = DataRowState.Modified) Then 'get value of that modified cell End If Next Method- 2 I tried to use dataview using Dim dview As New DataView(MyDataSet.Tables("MyTable")) dview.RowStateFilter = DataViewRowState.ModifiedOriginal And then iterating through each row of view, thinking that I get modified rows here..but does not wrok Method- 3 I tried to use following comarison objDRow.Item(2, DataRowVersion.Original) <> objDRow.Item(2, DataRowVersion.Current) not working. But surprisingly if you change the row value through code : it marks the row as modified row. for example objDRow.Item(2) = "xtz" <-------- i am changing the value here progrmmatically. Now if I do MsgBox(objDRow.RowState) then the state is modified ??? So the question is how do we detect mdofied rows ( or cells ) on datagrid rows when changes are made through visual interface, I mean directly from editing datagrid ?? Please if anyone knows let me know asap. Thanks.
Reply
Answers (
4
)
locations based application
Stay on top window