By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,665 Members | 1,513 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,665 IT Pros & Developers. It's quick & easy.

CompositeControl & CompositeDataBoundControl question

P: n/a
Hi

I want to create an n-tier custom server control.

The idea is that the control will determine [at run-time] which "view" will
be used. By this I mean User A may want the data displayed as a tree-view,
User B as a datagrid etc, etc.

So, I can envisage that in some circumstances it is using a data bound
control and in others a non-data bound control - who knows. In which case,
which do I inherit from - the CompositeControl or the
CompositeDataBoundControl?

Griff
Oct 11 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hey Griff, both TreeView and DataGrid (GridView) are Data Bound
controls. Whenever you have a control that your binding to a
repeatable datasource (something that implements IEnumerable) go with
the CompositeDataBoundControl. It sounds like this is what you want.

Even if you were not binding to a repeatable data source (let's say you
were binding to a Detail view of a record that was shown in list) the
CompositeDataBoundControl can help you out because it has a DataSource
and other properties/methods. THis is something the CompositeControl
doesn't have. This will help your end user have a consistent API with
data related controls.

If there's Data Involved, go with CompositeDataBoundControl. It has
the necessary support for working with a datasource, whether it's
repeatable or not.

Michael Hamrah

Griff wrote:
Hi

I want to create an n-tier custom server control.

The idea is that the control will determine [at run-time] which "view" will
be used. By this I mean User A may want the data displayed as a tree-view,
User B as a datagrid etc, etc.

So, I can envisage that in some circumstances it is using a data bound
control and in others a non-data bound control - who knows. In which case,
which do I inherit from - the CompositeControl or the
CompositeDataBoundControl?

Griff
Oct 12 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.