views:

17

answers:

1

I have a simple custom control that boils down to a label and a listbox. Selections in the listbox are reflected in the label as comma separated values.

My question is what is the best and simplest way to make the page developers experience of working with the custom control exactly mimic the experience of working with just the listbox - when it comes to working with data. For some reason it feels wrong to simply create mirrored properties in the custom control and forward their values to the internal listbox.

A small, perhaps unrelated complication is that the final product has to play nice with the forms collection due to the nature of the host application.

A: 

I think the best way is exposing DataSource property and DataBind method of the ListBox (encapsulating them with members of your control). I don't see any problem with that.

Claudio Redi
Ok this is essentially the approach I settled on. Thanks!
darlingtont