468,134 Members | 1,248 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,134 developers. It's quick & easy.

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 2314
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Britney | last post: by
10 posts views Thread by Fares Eidi | last post: by
2 posts views Thread by Andrew Poulos | last post: by
2 posts views Thread by David Veeneman | last post: by
1 post views Thread by Peter | last post: by
reply views Thread by Mahmoud Al-Qudsi | last post: by
9 posts views Thread by =?Utf-8?B?VGVycnk=?= | last post: by
10 posts views Thread by =?Utf-8?B?UiBSZXllcw==?= | last post: by
27 posts views Thread by didacticone | last post: by
1 post views Thread by gcdp | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.