473,405 Members | 2,344 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,405 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 2243
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 that accepts user:password:file connections from...
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 where the information to populate the first...
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 appropriate listing based on that combobox's selected...
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 from the gris to fill some textboxes. The databases...
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 false on isvalid and so does the Page, no matter...
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 are two tables with a 1 to 1 relationship. I...
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) Product names (DropDownList) product number (text...
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 itemtemplate... another table - server side (Table2)...
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 displays the email id. its working fine till...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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...

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.