Data binding to a CompositeControl
- From: intrader <intrader@xxxxxxx>
- Date: Wed, 14 Mar 2007 13:37:09 -0700
I am very new at using the CompositeControl or CompositeDataBoundControl and at DataBinding in general
My requirement is that I would like to declaratively tell my control to bind to a specific instance of a class; the control then looks at the metadata held in the instance to provide the appropriate control behavior.
The syntax follows the 'standard' <tag:controlname DataSource="here I don't know what to specify" />. What I want in "here I don't know what to specify" is something like instanceName.someFieldOrProperty, where the field (property) has a metadata to describe the behavior of the field.
From within the control I would like to be able to access the field via the DataSource property.
I thought of using an event driven approach and have the control.DataBinding event execute an event handler that would take the DataSource of some container (like a panel) and figure out the metadata in the field of the data source; but, this seems overly complex.
In a nutshell, given an instance fld containing a reference to someClass.someFieldOrProperty, I would like the more direct approach of using DataSource ="fld". Is 'fld' accessible within the code of the control?
Thanks
P.S. I have been following the very good examples in the newsgroup, but I have not figured this out yet.
.
- Follow-Ups:
- Continuing: Data binding to a CompositeControl
- From: intrader
- Continuing: Data binding to a CompositeControl
- Prev by Date: Re: how to show multiple fields in a listbox?
- Next by Date: Re: web.config servercontrol binding problem
- Previous by thread: Property Window and 3rd party webcontrols
- Next by thread: Continuing: Data binding to a CompositeControl
- Index(es):
Relevant Pages
|
Loading