473,804 Members | 2,296 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

binder.Current. row.rowstate not reflecting actual state of child row


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.

I have a navigation pallete with the usual arrows. All arrow btn's are
handled by the same handler.

Before moving off the current record I do the following:

BindingContext( Me.DataSet11, "table2").EndCu rrentEdit()

BindingContext( Me.DataSet11, "table1").EndCu rrentEdit()

'deal with current row state 1st

checkRowState(s ender, e)
CheckRowSTate looks at the rowstate and calls the SaveRecord routnine if
needed.
Select Case mbinder.Current .row.rowstate
Case DataRowState.Ad ded

Call saveRecord()

Case DataRowState.Mo dified

Call saveRecord()

End Select

Select Case mbinder2.Curren t.row.rowstate

Case DataRowState.Ad ded

Call saveRecord()

Case DataRowState.Mo dified

Call saveRecord()

End Select

The problem i'm having is this: after changing a value in the child
(datagrid) description field the rowstate remains unchanged on the 2nd or
greater master record. If I make a change to the child rec on the 1st
master the rowstate is 'modified' as expected.....

at this point i'm just bewildered..... ........
Nov 21 '05 #1
6 1788
Astro,

I am afraid that I don't understand your problem, however, a rowstate
reflects only the state of the changed datarow, where it is not important if
this is a child or a master.

To get more answers, I give you the advice to past in next time your code
first in a notebook copy it back and past it in a message. Now it is hard to
see in most newsreaders what your code looks like.

I hope this helps anyhow

Cor
Nov 21 '05 #2
Thanks Cor -- )

I am trying to trap state changes for a child table on a form when from
'unchanged' to 'modified' or 'added.' The code I am using does not do this.
I will repost it here:

form load:
========
cmT2 = CType(Me.Bindin gContext(Me.Dat aSet11.Tables!t able2), CurrencyManager )
custom SaveRecord event:
=============== ====

cmT2.EndCurrent Edit()

Select Case cmT2.Current.ro w.rowstate
Case DataRowState.Ad ded
Stop
Case DataRowState.Mo dified
Stop
End Select
Before the postion changes on the form's master record, the 'saverecord'
code is called. When I make changes to the datagrid - which is populated by
the 'child' table and linked via the 'datamember' property using the
'table1table2' relation - and then move to another 'parent' record the
saveRecord event is called does not report an 'Added' or 'Modified' state in
the child table.

any ideas?


"Cor Ligthert [MVP]" <no************ @planet.nl> wrote in message
news:eM******** ******@TK2MSFTN GP10.phx.gbl...
Astro,

I am afraid that I don't understand your problem, however, a rowstate
reflects only the state of the changed datarow, where it is not important
if this is a child or a master.

To get more answers, I give you the advice to past in next time your code
first in a notebook copy it back and past it in a message. Now it is hard
to see in most newsreaders what your code looks like.

I hope this helps anyhow

Cor

Nov 21 '05 #3
Hi,
[inline]

"astro" <as***@mnrr.com > wrote in message
news:Oj******** *******@tornado .rdc-kc.rr.com...
Thanks Cor -- )

I am trying to trap state changes for a child table on a form when from
'unchanged' to 'modified' or 'added.' The code I am using does not do
this. I will repost it here:

form load:
========
cmT2 = CType(Me.Bindin gContext(Me.Dat aSet11.Tables!t able2),
CurrencyManager )
There is a chance you're getting the wrong CurrencyManager and so the wrong
Current DataRowView. You have to use the same DataSource/DataMember that
you used for binding to get the CurrencyManager .

Eg.:
detailGrid.Data Source = DataSet11
detailGrid.Data Member = "master_table.m aster_to_detail _relation"

cmT2 = DirectCast(Bind ingContext(Data Set11,
"master_table.m aster_to_detail _relation"), CurrencyManager )

A more generic way:
cmT2 = DirectCast(Bind ingContext(deta ilGrid.DataSour ce,
detailGrid.Data Member), CurrencyManager )

Also, if your detail table can contain multiple detail rows for each master
row, then you might want to use detailTable.Get Changes() or
detailTable.Sel ect(), because the user could have changed multiple detail
rows before navigating master rows.

HTH,
Greetings



custom SaveRecord event:
=============== ====

cmT2.EndCurrent Edit()

Select Case cmT2.Current.ro w.rowstate
Case DataRowState.Ad ded
Stop
Case DataRowState.Mo dified
Stop
End Select
Before the postion changes on the form's master record, the 'saverecord'
code is called. When I make changes to the datagrid - which is populated
by the 'child' table and linked via the 'datamember' property using the
'table1table2' relation - and then move to another 'parent' record the
saveRecord event is called does not report an 'Added' or 'Modified' state
in the child table.

any ideas?


"Cor Ligthert [MVP]" <no************ @planet.nl> wrote in message
news:eM******** ******@TK2MSFTN GP10.phx.gbl...
Astro,

I am afraid that I don't understand your problem, however, a rowstate
reflects only the state of the changed datarow, where it is not important
if this is a child or a master.

To get more answers, I give you the advice to past in next time your code
first in a notebook copy it back and past it in a message. Now it is hard
to see in most newsreaders what your code looks like.

I hope this helps anyhow

Cor



Nov 21 '05 #4
Astro,
Before the postion changes on the form's master record, the 'saverecord'
code is called.


How are you able to do that? (before)

Cor
Nov 21 '05 #5
ahhhhhhhhhhhh - I tried that before in a slighly different syntax and just
missed it.

Thanks !!

"Bart Mermuys" <bm************ *@hotmail.com> wrote in message
news:%2******** *******@TK2MSFT NGP09.phx.gbl.. .
Hi,
[inline]

"astro" <as***@mnrr.com > wrote in message
news:Oj******** *******@tornado .rdc-kc.rr.com...
Thanks Cor -- )

I am trying to trap state changes for a child table on a form when from
'unchanged' to 'modified' or 'added.' The code I am using does not do
this. I will repost it here:

form load:
========
cmT2 = CType(Me.Bindin gContext(Me.Dat aSet11.Tables!t able2),
CurrencyManager )


There is a chance you're getting the wrong CurrencyManager and so the
wrong
Current DataRowView. You have to use the same DataSource/DataMember that
you used for binding to get the CurrencyManager .

Eg.:
detailGrid.Data Source = DataSet11
detailGrid.Data Member = "master_table.m aster_to_detail _relation"

cmT2 = DirectCast(Bind ingContext(Data Set11,
"master_table.m aster_to_detail _relation"), CurrencyManager )

A more generic way:
cmT2 = DirectCast(Bind ingContext(deta ilGrid.DataSour ce,
detailGrid.Data Member), CurrencyManager )

Also, if your detail table can contain multiple detail rows for each
master
row, then you might want to use detailTable.Get Changes() or
detailTable.Sel ect(), because the user could have changed multiple detail
rows before navigating master rows.

HTH,
Greetings



custom SaveRecord event:
=============== ====

cmT2.EndCurrent Edit()

Select Case cmT2.Current.ro w.rowstate
Case DataRowState.Ad ded
Stop
Case DataRowState.Mo dified
Stop
End Select
Before the postion changes on the form's master record, the 'saverecord'
code is called. When I make changes to the datagrid - which is populated
by the 'child' table and linked via the 'datamember' property using the
'table1table2' relation - and then move to another 'parent' record the
saveRecord event is called does not report an 'Added' or 'Modified' state
in the child table.

any ideas?


"Cor Ligthert [MVP]" <no************ @planet.nl> wrote in message
news:eM******** ******@TK2MSFTN GP10.phx.gbl...
Astro,

I am afraid that I don't understand your problem, however, a rowstate
reflects only the state of the changed datarow, where it is not
important
if this is a child or a master.

To get more answers, I give you the advice to past in next time your
code
first in a notebook copy it back and past it in a message. Now it is
hard
to see in most newsreaders what your code looks like.

I hope this helps anyhow

Cor



Nov 21 '05 #6
See Bart's response Cor.

0)

"Cor Ligthert [MVP]" <no************ @planet.nl> wrote in message
news:%2******** ********@TK2MSF TNGP15.phx.gbl. ..
Astro,
Before the postion changes on the form's master record, the 'saverecord'
code is called.


How are you able to do that? (before)

Cor

Nov 21 '05 #7

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

Similar topics

0
2086
by: TEbert | last post by:
I have an Expression based DataColumn that is defined to calculate the Qty sum of all child rows, based on a self-referencing relationship (i.e. Parent.aggregateQty = sum(Child(linkedRelationship).Qty) where both Parent and Children are entries to the same DataTable. I'm finding that if I create a new Child row and link it to a pre-existing Parent, the next time I trigger an update event on that Parent row I get a Error: "An unhandled...
6
13489
by: BStorm | last post by:
Is it possible to change individual RowState properties from updated to not updated?
3
2799
by: John Dalberg | last post by:
I am setting the HttpContext.Current.User in the Application_AuthenticateRequest event in global.asax.cs. When I use the IsInRole function in a web page, it works fine. So far so good. (Note that Integrated security is used and anonymous is turned off.) This app will actually work as a child app for an Intranet app so when I remove the application designation in IIS for the child app folder, IsInRole is always null, which is not good. I...
3
1763
by: | last post by:
Hi all, I have a question on reflection Lets say I have a custom object called Address. Now, lets say I have a string variable that holds the name of a variable in the object such as "State.StateCode". How can I reflect upon the Address object so as to echo the value contained in the string variable. Something like:- Dim add as new Address add.State.StateCode = "TX" Dim str as string = "State.StateCode"
2
8498
by: osmarjunior | last post by:
Is there a way to change manually the RowState property of a DataRow, in a DataTable?? I wanna create a DataTable in memory, so I do the following: DataRow row = tbl.DataTable.NewRow(); row = Customer.ID; row = Customer.Name tbl.DataTable.Rows.Add(row); This is just an example. I know that the RowState property is
3
10843
by: namewitheldbyrequest | last post by:
"The XML element 'EnableTheming' from namespace 'http://tempuri.org/' is already present in the current scope" I created a Web Service: I imported System.Data.SqlClient so I could access SQL server tables programmatically. The web service builds and deploys with no problems. When I try to add the corresponding Web Reference to the Web Site project I get the error listed below. I am able to create other Web Services on the same server...
1
2852
by: Arpan | last post by:
What's the difference between RowState & DataViewRowState? If I am not mistaken, RowState pertains to DataTable whereas DataViewRowState pertains to DataView but the "Select" method of the DataTable uses the DataViewRowState as the 3rd parameter & not RowState. I am getting confused between the two! Please correct me if I am wrong. Thanks,
13
11826
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 to a DataSet. If I don't do anything to the DataSet other than load data normally through TableAdapters everything works fine. If I load a table(static data for ComboBox) in the DataSet manually; the DataSet now says it has changes. I call...
3
2276
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 go back to previous state and no data has entered in database yet but in my master table in memory it has data.. ???? how can I change RowState of master table to previous RowState before begining Save. thanks in advance
0
9594
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10599
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10346
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10347
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10090
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9173
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5531
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.