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

currencymanager.position doesn't change

I have a dataset containing 2 tables. A is the master table, B is a lookup
table. There is a combobox bound to B, which updates a value in a FK field
in A.

my currencymanager is created thus:
cmB= CType(frm.BindingContext(DsClient1.Tables("B")), CurrencyManager)

The cbx has these settings:
cbx.valuemember=b.primarykey
cbx.displaymember=b.name
cbx.datasource=dsclient1
cbx.(databindings).selecteditem=b.primarykey
cbx.(databindings).selectedvalue=a.foreignkey
cbx.(databindings).text=b.name

When I change the value in the combobox, cmClientMaster.position does not
change.

Any suggestions?

Jeremy

Nov 21 '05 #1
4 4094

You show us you assinging cmB being assinged a Binding Context.. yet you
talk about cmClientMaster.

Same thing? or perhaps a typo? or just something you missed. =)

-CJ
"Jeremy" <je****@ninprodata.com> wrote in message
news:Ox*************@TK2MSFTNGP10.phx.gbl...
I have a dataset containing 2 tables. A is the master table, B is a lookup
table. There is a combobox bound to B, which updates a value in a FK field in A.

my currencymanager is created thus:
cmB= CType(frm.BindingContext(DsClient1.Tables("B")), CurrencyManager)

The cbx has these settings:
cbx.valuemember=b.primarykey
cbx.displaymember=b.name
cbx.datasource=dsclient1
cbx.(databindings).selecteditem=b.primarykey
cbx.(databindings).selectedvalue=a.foreignkey
cbx.(databindings).text=b.name

When I change the value in the combobox, cmClientMaster.position does not
change.

Any suggestions?

Jeremy

Nov 21 '05 #2
CJ, it's the same thing. Any ideas on cause & cure?

Jeremy

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:eV**************@tk2msftngp13.phx.gbl...

You show us you assinging cmB being assinged a Binding Context.. yet you
talk about cmClientMaster.

Same thing? or perhaps a typo? or just something you missed. =)

-CJ

Nov 21 '05 #3
Alright... lets try a couple things.

First.. get rid of this crap
cbx.(databindings).selecteditem=b.primarykey
cbx.(databindings).selectedvalue=a.foreignkey
cbx.(databindings).text=b.name
second..

just use

cbx.selectedvalue = a.foreignkey

third...

if all that doesnt work.. define your currency manager as

cmB = Ctype(BindingContext(dsClient1, "B"), CurrencyManager)

that should respond when the value changes in the lookup box (combo box).
your master has to respond differently.. try this and we'll get to more
later.

by the way, what is the frm.Bindingcontext? Self reference? or are you
doing this outside of the scope of your form (the manager resides in a
different class than the form itself.)

-CJ


my currencymanager is created thus:
cmB= CType(frm.BindingContext(DsClient1.Tables("B")), CurrencyManager)

The cbx has these settings:
cbx.valuemember=b.primarykey
cbx.displaymember=b.name
cbx.datasource=dsclient1
>

When I change the value in the combobox, cmClientMaster.position does not
change.

Any suggestions?

Jeremy

Nov 21 '05 #4
CJ, changing the currencymanager to

cmB = Ctype(BindingContext(dsClient1, "B"), CurrencyManager)

made the main difference.

I took out the (databindings) as you suggested, except for selectedvalue
(can't seem to find the cbx.selectedvalue property in the property
inspector).

frm is because the form is started with a shared method
(myform.Execute(sdasd,asdfasdf,asdfsf) that does a new on the form. It's an
mdi app.

Thanks, I greatly appreciate your help. Hopefully I'll figure out how to
find stuff like this in the dox someday.

Jeremy
"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:eu**************@TK2MSFTNGP12.phx.gbl...
Alright... lets try a couple things.

First.. get rid of this crap
cbx.(databindings).selecteditem=b.primarykey
cbx.(databindings).selectedvalue=a.foreignkey
cbx.(databindings).text=b.name


second..

just use

cbx.selectedvalue = a.foreignkey

third...

if all that doesnt work.. define your currency manager as

cmB = Ctype(BindingContext(dsClient1, "B"), CurrencyManager)

that should respond when the value changes in the lookup box (combo box).
your master has to respond differently.. try this and we'll get to more
later.

by the way, what is the frm.Bindingcontext? Self reference? or are you
doing this outside of the scope of your form (the manager resides in a
different class than the form itself.)

-CJ


my currencymanager is created thus:
cmB= CType(frm.BindingContext(DsClient1.Tables("B")), CurrencyManager)
The cbx has these settings:
cbx.valuemember=b.primarykey
cbx.displaymember=b.name
cbx.datasource=dsclient1
>

When I change the value in the combobox, cmClientMaster.position does not change.

Any suggestions?

Jeremy


Nov 21 '05 #5

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

Similar topics

1
by: Pete Davis | last post by:
I have written a custom databound grid control that we've been using successfully for months, but one of our developers has just run into a problem that I can't figure out. The code for setting...
4
by: Kris Bethea via DotNetMonster.com | last post by:
Greetings, I have a VB.NET program that I am trying to convert to C# (my office decided that we are going to use C# from now on). I've only been working with C# for about a month now, so this...
1
by: Christopher Weaver | last post by:
When I add a row to my DataTable my CurrencyManager doesn't know it's there. I have a ComboBox and a CurrencyManager bound to a DataTable such that a selection within the ComboBox causes all...
10
by: D | last post by:
hi I have a form with 2 datagrids showing related table data in a master / child or order / order details type relationship. I would like to auto select the row in the order details table which...
0
by: NetRacer | last post by:
hi, i have a form with a read-only datagrid and some other controls. the controls are bound to the same DataView as the datagrid. i want the user to select a row in the grid and then he can edit...
2
by: Rich | last post by:
Hello, I have a datagrid (dgr1) on a form and I'm trying to bind a currencyManager Object (cma) to it and print the current row position. But all I get for cma.Position is 0, 0, 0 for any row...
3
by: Brian Richardson | last post by:
Hi, Please can anyone kindly offer some suggestions as to why the CurrencyManager might not refresh. I am using the CurrencyManager to navigate through a DataView. I am aware that there is...
2
by: Rich | last post by:
Hello, Following an example at http://www.vb-tips.com/dbpages.aspx?IA=DG (by Cor Lightert and Ken Tucker) on binding a dataRelation to a Datagridview for sqlClient, I was able to view rows...
0
by: polocar | last post by:
Hi, I have noticed a strange behaviour of CurrencyManager objects in C# (I use Visual Studio 2005 Professional Edition). Suppose that you have a SQL Server database with 2 tables called "Cities"...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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,...
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.