473,756 Members | 3,655 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2600
Matty,

Are you able to use .NET 2.0? If so, you can use the implement the
IBindableCompon ent interface, which will allow you to pass your control to
the ControlBindings Collection (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.co m

<ma********@gma il.com> wrote in message
news:11******** **************@ g14g2000cwa.goo glegroups.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
1931
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 has numerous tables in the 200 column range, with several thousand rows of data. A consulting review prior to my involvement stressed the wasted space and database speed as the major impetus for normalization. Although the db actually works fairly...
1
1359
by: Britney | last post by:
what exactly is data binding?
10
1924
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 to create my front end application. Building the data access forms using manual coding just seems like a lot of work.... Any guidance would be appreciated Fares
2
1444
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 looked at the source there is js like this: function forwardClick() { if (sitelist.recordset.AbsolutePosition != sitelist.recordset.RecordCount) { sitelist.recordset.moveNext();
2
4801
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 has a property with the same name, which takes an identical enum. Data binding isn't working, and I think it's because the two enums are different. Even though they have the same name and the same elements, they are declared under different...
1
6435
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 for the non-foreign key fields. When the user clicks on a row in the listbox, the comboboxes' SelectedItem changes to reflect the foreign key selections in the currently selected row. That part is working fine. I also want the textboxes to change to...
0
1413
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 different threads - from both static and non-static code. To do this, I created a static class "DataBase" and proceeded to
9
2804
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 datasource that contains the code. Now suppose that you want it to be read-only? That is, you have the 'code' in your DB, want the associated 'description' to display, but not let the user change it on this particular form. There is no read-only...
10
5847
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 rebuilding my company's Access 97 VBA database app. It pulls 115,000 items (of account names) from SqlServer and the data is bound to a single Access 97 ComboBox control. My C# version needs to work exactly like this one. Our executive employees want...
2
4230
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 Binding setting, you can apply it to your WCF service via the "bindingConfiguration" attribute of each <endpoint> here is a simple WCF service configuration in web.config which demonstrate this:
0
9456
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9872
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9843
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9713
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8713
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7248
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6534
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3805
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.