473,387 Members | 1,834 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,387 software developers and data experts.

'Nother, larger binding problem

OK, so in addition to the problem I mentioned before (c.f. "Data Binding to
Textbox"), I realized that my comboboxes are not really bound to the
internal data set. They are just set to manually change to reflect whatever
the selected row's foreign keys are.

So the question is, how can I bind the SelectedItem of a combobox, which is
filled with DataRowView objects from its bound table, to a field in
whichever row of a dataset happens to be selected in a Listbox, also full of
bound DataRowView objects?

That's a lotta words. Does it make sense? I basically want the same
combobox, populated with all possible parent table values, to be able to
edit a foreign key field in whatever row of a table (from a strongly typed
dataset) happens to be selected in a listview.

And I don't want to use a datagrid control because there is no
DataColumnComboBox control in VS 2002.

Apr 20 '07 #1
3 1629
Peter,

Databinding is very simple, let say you want to bind a textbox to a combobox
both there text area

You start with the textbox.

Textbox1.Databinding.Add("Text",Combobox1,"Text")

Be aware that DataBinding is a collection from Textbox1 and has no direct
relation with combobox1. (you can not see in combobox1 that it is bound)

Cor
"Peter" <st*****@hotmail.comschreef in bericht
news:ZI*****************@newsread2.news.pas.earthl ink.net...
OK, so in addition to the problem I mentioned before (c.f. "Data Binding
to Textbox"), I realized that my comboboxes are not really bound to the
internal data set. They are just set to manually change to reflect
whatever the selected row's foreign keys are.

So the question is, how can I bind the SelectedItem of a combobox, which
is filled with DataRowView objects from its bound table, to a field in
whichever row of a dataset happens to be selected in a Listbox, also full
of bound DataRowView objects?

That's a lotta words. Does it make sense? I basically want the same
combobox, populated with all possible parent table values, to be able to
edit a foreign key field in whatever row of a table (from a strongly typed
dataset) happens to be selected in a listview.

And I don't want to use a datagrid control because there is no
DataColumnComboBox control in VS 2002.

Apr 20 '07 #2
That type of data binding is indeed simple.

But I don't have any idea where to start with a more complex question such
as what I'm trying to do... i.e. have the row to which my controls are bound
change based on the user's row selection in a listbox. Can you give me an
equally simple line of code that will do that?

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
Peter,

Databinding is very simple, let say you want to bind a textbox to a
combobox both there text area

You start with the textbox.

Textbox1.Databinding.Add("Text",Combobox1,"Text")

Be aware that DataBinding is a collection from Textbox1 and has no direct
relation with combobox1. (you can not see in combobox1 that it is bound)

Cor
"Peter" <st*****@hotmail.comschreef in bericht
news:ZI*****************@newsread2.news.pas.earthl ink.net...
>OK, so in addition to the problem I mentioned before (c.f. "Data Binding
to Textbox"), I realized that my comboboxes are not really bound to the
internal data set. They are just set to manually change to reflect
whatever the selected row's foreign keys are.

So the question is, how can I bind the SelectedItem of a combobox, which
is filled with DataRowView objects from its bound table, to a field in
whichever row of a dataset happens to be selected in a Listbox, also full
of bound DataRowView objects?

That's a lotta words. Does it make sense? I basically want the same
combobox, populated with all possible parent table values, to be able to
edit a foreign key field in whatever row of a table (from a strongly
typed dataset) happens to be selected in a listview.

And I don't want to use a datagrid control because there is no
DataColumnComboBox control in VS 2002.

Apr 21 '07 #3
This is of the same simplisity

http://www.vb-tips.com/dbpages.aspx?...8-4e3f3fedb997

Cor

"Peter" <st*****@hotmail.comschreef in bericht
news:LV*****************@newsread2.news.pas.earthl ink.net...
That type of data binding is indeed simple.

But I don't have any idea where to start with a more complex question such
as what I'm trying to do... i.e. have the row to which my controls are
bound change based on the user's row selection in a listbox. Can you give
me an equally simple line of code that will do that?

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>Peter,

Databinding is very simple, let say you want to bind a textbox to a
combobox both there text area

You start with the textbox.

Textbox1.Databinding.Add("Text",Combobox1,"Text ")

Be aware that DataBinding is a collection from Textbox1 and has no direct
relation with combobox1. (you can not see in combobox1 that it is bound)

Cor
"Peter" <st*****@hotmail.comschreef in bericht
news:ZI*****************@newsread2.news.pas.earth link.net...
>>OK, so in addition to the problem I mentioned before (c.f. "Data Binding
to Textbox"), I realized that my comboboxes are not really bound to the
internal data set. They are just set to manually change to reflect
whatever the selected row's foreign keys are.

So the question is, how can I bind the SelectedItem of a combobox, which
is filled with DataRowView objects from its bound table, to a field in
whichever row of a dataset happens to be selected in a Listbox, also
full of bound DataRowView objects?

That's a lotta words. Does it make sense? I basically want the same
combobox, populated with all possible parent table values, to be able to
edit a foreign key field in whatever row of a table (from a strongly
typed dataset) happens to be selected in a listview.

And I don't want to use a datagrid control because there is no
DataColumnComboBox control in VS 2002.


Apr 21 '07 #4

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

Similar topics

14
by: Composer | last post by:
I've read many postings about the problem of Access.References.IsBroken and the consensus seems to be that late binding is the cure-all. I have a very complex Access application that needs...
9
by: Zlatko Matić | last post by:
I was reading about late binding, but I'm not completely sure what is to be done in order to adjust code to late binding... For example, I'm not sure if this is correct: early binding: Dim ws...
8
by: scorpion53061 | last post by:
I am sorry for this but I am not getting an answer elsewhere so I thought I would try here. It seems the safer way to go prior to deployment is to change my early binding to late binding to...
19
by: Simon Verona | last post by:
I'm not sure if I'm going down the correct route... I have a class which exposes a number of properties of an object (in this case the object represents a customer). Can I then use this...
1
by: Bruce | last post by:
Hi, there, I meet a problem about comboBox binding. -------------------- Database: Northwind Tables: 1) Products 2) Categories I create a form (named "form1") to edit the record from...
0
by: JSantora | last post by:
Essentially, InsertAT is broken! For the past couple of hours, I've been getting this "Parameter name: '-2147483550' is not a valid value for 'index'." error. Apparently, its caused by having...
3
by: Simon Tamman | last post by:
I've come across an interesting bug. I have workarounds but i'd like to know the root of the problem. I've stripped it down into a short file and hope someone might have an idea about what's going...
7
by: Steve K | last post by:
First problem: I am specifying a format string for a Binding object like so: <code> Binding binding = new Binding("Text", item.EOBRemittance, "AmountAllowed", true, DataSourceUpdateMode.Never,...
0
by: furqanms | last post by:
Hello, I am new to WPF ,I am developing touch screen system using WPF. I am facing problem in Binding relative reference. Here is my code : <UserControl x:Class="uctlBrowser" ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...

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.