472,353 Members | 1,190 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,353 software developers and data experts.

Bind Text Box based on list box selection

Hello All:

What I am trying to do is bind a textbox (really several
text boxes) based on a list box selection. Basically what
I'm dealing with are two tables with a 1 to 1
relationship.

I have created the dataset and defined the relationship
between the two tables in the schema. I add a list box to
a form and set it's datasource to the parent table and its
displaymember to the value I want to display from the
parent table, in my case:

DataSource = dsData.WNTable
DisplayMember = WN

Where
a.) "dsData" is the name of the dataset
b.) "WN" is the name of a field in the WNTable

Because the relationship is 1 to 1 I don't need to use a
datagrid (I can get this to work with a datagrid but this
is not ideal b/c it only returns 1 row). I only need a
text box for each value I want to display, so in my case I
want to add 3 text boxes that are bound by the
parent/child relationship so when I select an item from
the list the relevant data appears in the text boxes. I
tried setting the Text property of each text box by using
the defined relationship, for example one of the text
boxes Text property is:

dsData - WNTable.WN_Act.DFS

where
a.) "dsData" is the datset
b.) "WN_Act" is the relationship name that defines the
relationship between the WNTable and the ActTable
c.) "DFS" is a field in the ActTable, this is the value I
want to display in the text box.

When I run the program the list box and the text boxes are
not "related" at all. Is there a way to do this or do I
have to use a datagrid even though it would only contain 1
row of information? I set all of the properties,
relationships, etc. at design time (not with code). I
don't think this should matter but maybe it does. Please
Help!!

Many Thanks in Advance,

Jeff
Jul 21 '05 #1
2 2175
Are you using a Binding Context and Or a BindingManagerBase? That looks
like the problem... CHeck this out...
http://www.akadia.com/services/dotnet_databinding.html

HTH,

Bill
"Jeff" <jf***@marjoop.com> wrote in message
news:08****************************@phx.gbl...
Hello All:

What I am trying to do is bind a textbox (really several
text boxes) based on a list box selection. Basically what
I'm dealing with are two tables with a 1 to 1
relationship.

I have created the dataset and defined the relationship
between the two tables in the schema. I add a list box to
a form and set it's datasource to the parent table and its
displaymember to the value I want to display from the
parent table, in my case:

DataSource = dsData.WNTable
DisplayMember = WN

Where
a.) "dsData" is the name of the dataset
b.) "WN" is the name of a field in the WNTable

Because the relationship is 1 to 1 I don't need to use a
datagrid (I can get this to work with a datagrid but this
is not ideal b/c it only returns 1 row). I only need a
text box for each value I want to display, so in my case I
want to add 3 text boxes that are bound by the
parent/child relationship so when I select an item from
the list the relevant data appears in the text boxes. I
tried setting the Text property of each text box by using
the defined relationship, for example one of the text
boxes Text property is:

dsData - WNTable.WN_Act.DFS

where
a.) "dsData" is the datset
b.) "WN_Act" is the relationship name that defines the
relationship between the WNTable and the ActTable
c.) "DFS" is a field in the ActTable, this is the value I
want to display in the text box.

When I run the program the list box and the text boxes are
not "related" at all. Is there a way to do this or do I
have to use a datagrid even though it would only contain 1
row of information? I set all of the properties,
relationships, etc. at design time (not with code). I
don't think this should matter but maybe it does. Please
Help!!

Many Thanks in Advance,

Jeff

Jul 21 '05 #2
William:

Thank's for the pointer. I figured out what was wrong, I was setting
the data source incorrectly for the list box so there were two different
currency managers. Thanks for you help.

Jeff

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #3

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

Similar topics

11
by: Ed Suominen | last post by:
I'm thinking of implementing a real-time collaborative text editor in Python using Twisted. An initial plan is to use a Twisted PB server daemon...
5
by: Jim Cobban | last post by:
I am trying to create a web page in which the contents of one selection list depends upon which element in another selection list is chosen, but...
6
by: Alpha | last post by:
I have a listbox with datasource from a dataview. When a user selects a different item in a combobox then I need to refresh the listbox to the...
0
by: Steve | last post by:
Hi I have a db with 2 tables that I want to bind to a grid depending on a selection in a Dropdownlist Also I want to be able to select a row...
3
by: me | last post by:
Is there any particular reason why a requiredfieldvalidator cant validate a listbox? I have bound the two together but the validator always returns...
2
by: Jeff | last post by:
Hello All: What I am trying to do is bind a textbox (really several text boxes) based on a list box selection. Basically what I'm dealing with...
1
by: serge calderara | last post by:
Dear all I have an ASP 1.1 application on which my user can filled some selection querry field like : ProductCatergorys (DropDownlist box)...
2
by: Phil | last post by:
I have a datalist (DataList1)... with an itemtemplate... then a table - server side (Table1)... then another datalist (DataList2)... another...
1
by: angelicdevil | last post by:
i have listbox 1 which displays status , based on selection of status listbox 2 displays usernames. and based on username selected the textbox...
1
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific...
0
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand....

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.