Puedes crear un control que te permita realizar esa funcionalidad, toma como referencia éste post:
Cita: I succed to build the control extending from DataBoundControl this is my fast code and it works perfectly
[ToolboxData("<{0}:Picturelist runat=server></{0}:Picturelist>")]
public class Picturelist : DataBoundControl
{
private Image _image;
private DropDownList _dropList;
private Literal lt;
protected override void CreateChildControls()
{
Controls.Clear();
_image = new Image();
_dropList = new DropDownList();
lt = new Literal();
lt.Text = "</br>";
this.Controls.Add(_image);
this.Controls.Add(lt);
this.Controls.Add(_dropList);
base.CreateChildControls();
//return 0;
}
// only my ddl is shown for the moment
protected override void Render(HtmlTextWriter output)
{
_dropList.RenderControl(output);
}
protected override void PerformDataBinding(System.Collections.IEnumerable dataSource)
{
base.PerformDataBinding(dataSource);
if (dataSource != null)
{
List l = new List();
foreach (object o in dataSource)
{
l.Add(DataBinder.GetPropertyValue(o, "nom", null));
}
_dropList.DataSource = l;
_dropList.DataBind();
}
}
}
As u see, in the render method I only show my ddl control, but know my PictureList control must extend the CompositeDataboundContol so I can show both ddl and the image, I know that I have to override the method
protected override int CreateChildControls(System.Collections.IEnumerable dataSource, bool dataBinding)
but I didnt know how to use it for binding my ddl instead of using PerformDataBinding
referencia:
http://forums.asp.net/thread/1255581.aspx
También puedes hacer uso del
DropDownExtender que viene en el toolkit de Ajax que funciona bastante bien y la implementación es super sencilla para colocar los objetos que necesites.
Salu2