PC Review


Reply
Thread Tools Rate Thread

currencymanager.position doesn't change

 
 
Jeremy
Guest
Posts: n/a
 
      26th Aug 2004
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



 
Reply With Quote
 
 
 
 
CJ Taylor
Guest
Posts: n/a
 
      26th Aug 2004

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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>
>
>



 
Reply With Quote
 
Jeremy
Guest
Posts: n/a
 
      26th Aug 2004
CJ, it's the same thing. Any ideas on cause & cure?

Jeremy

"CJ Taylor" <[cege] at [tavayn] dit commmmm> wrote in message
news:(E-Mail Removed)...
>
> 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



 
Reply With Quote
 
CJ Taylor
Guest
Posts: n/a
 
      26th Aug 2004
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
>
>
>



 
Reply With Quote
 
Jeremy
Guest
Posts: n/a
 
      26th Aug 2004
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:euUF$(E-Mail Removed)...
> 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
> >
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why doesn't changing the position in a table change the position of the DatGridView that's bound to it? Sam Malone Microsoft VB .NET 2 2nd Jun 2006 02:40 PM
help with currencymanager position =?Utf-8?B?cm9zc3U=?= Microsoft ADO .NET 2 4th Dec 2005 10:37 PM
CurrencyManager Position issue Pete Davis Microsoft Dot NET Framework Forms 2 7th Apr 2005 10:44 PM
CurrencyManager.Position ?? Chris Microsoft C# .NET 1 31st Mar 2004 02:56 PM
Combo currencymanager position not set Shravan Microsoft C# .NET 0 7th Nov 2003 10:40 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:46 AM.