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

Data Binding NON-UI objects?

There's a lot of information out there about data-binding UI objects
(i.e. derived from Control) to non-UI custom business objects. Is it
possible to do the same without any UI being involved at all?

Here's an example:

I want to do data binding on some of the properties of a TreeNode
(namely its Name). Unfortunately, TreeNode does not derive from
Control, so it doesn't have the "stock" data binding stuff. I'd like
to create a new class that derives from TreeNode that reimplments this
data binding stuff.

I tried to create a PropertyManager and simply add data bindings to it,
but unfortunately the PropertyManager's DataBindings collection is
read-only. Is there anyway to accomplish something like this?

Although this question is specifically about TreeNode, I guess I'm
wondering about the more general question: how do I go about adding a
binding manager to a custom business object to give it binding support
like controls have?

Nov 17 '05 #1
1 2574
Matty,

Are you able to use .NET 2.0? If so, you can use the implement the
IBindableComponent interface, which will allow you to pass your control to
the ControlBindingsCollection (exposed by the DataBindings property on
controls, and on your class), and allow it to be data bound.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

<ma********@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
There's a lot of information out there about data-binding UI objects
(i.e. derived from Control) to non-UI custom business objects. Is it
possible to do the same without any UI being involved at all?

Here's an example:

I want to do data binding on some of the properties of a TreeNode
(namely its Name). Unfortunately, TreeNode does not derive from
Control, so it doesn't have the "stock" data binding stuff. I'd like
to create a new class that derives from TreeNode that reimplments this
data binding stuff.

I tried to create a PropertyManager and simply add data bindings to it,
but unfortunately the PropertyManager's DataBindings collection is
read-only. Is there anyway to accomplish something like this?

Although this question is specifically about TreeNode, I guess I'm
wondering about the more general question: how do I go about adding a
binding manager to a custom business object to give it binding support
like controls have?

Nov 17 '05 #2

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

Similar topics

4
by: Bill Stock | last post by:
The few times in the past that I've loaded unbound data, I've tended to cheat and use temp tables (not really unbound) or use code for small datasets. I'm currently involved in a project that...
1
by: Britney | last post by:
what exactly is data binding?
10
by: Fares Eidi | last post by:
I am a VB6 intermediate programmer just starting out using VB.net and would like to ask what I'd be missing out on if I just use time saving techniques like data binding, data adapter wizards etc...
2
by: Andrew Poulos | last post by:
A friend of mine has built as simple site for use on his company's intranet. It uses JavaScript to read comma-delimited information from a text file and displays it in tabular form. When I...
2
by: David Veeneman | last post by:
I want to data bind a user control and a business object, using a BindingSource control. The control has a 'Priority' property that takes a 'Priority' enum (High, Normal, Low). The business object...
1
by: Peter | last post by:
Hi, I'm trying to create a form that shows table rows in a listbox. Several comboboxes expand the foreign key fields into text values from the parent tables, and there are also some textboxes...
0
by: Mahmoud Al-Qudsi | last post by:
Hi all, What is the recommended way of binding controls to a *static* datasource? In my project, I have to use the same ADO.net data source/ bindingsource in mulitple forms and across...
9
by: =?Utf-8?B?VGVycnk=?= | last post by:
Think it is great the way that you can set up a datsource, value member, and display member for a combobox, and map a 'code' to a 'description' and back again by binding the combobox to a...
10
by: =?Utf-8?B?UiBSZXllcw==?= | last post by:
Hi, Problem: How can I databind (or put) a SqlServer query's row return of 115,000 items into a ComboBox quickly? Not much longer than a matter of seconds, that is... Scenario: I am...
2
by: Steven Cheng | last post by:
Hi Gary, As for the setting you mentioned, it is used to custimze the received data size limitation of WCF binding(such as NetTcpBinding or HttpBinding). After you have definite a customized...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.