hola!
quisiera saber si se puede meter imagen en un dropdownlist.
Gracias
| |||
Re: se puede meter imagen en dropdownlist? hola! es decir, el dropdownlist convertirlo como una tabla. ¿y como hago para que funcione como un dropdownlist? que se deslice, se abra cuando se quiera, etc. |
| ||||
Re: se puede meter imagen en dropdownlist? Puedes crear un control que te permita realizar esa funcionalidad, toma como referencia éste post: Cita: referencia: http://forums.asp.net/thread/1255581.aspx 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 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
__________________ Nadie roba nada ya que en la vida todo se paga . . . Exentrit - Soluciones SharePoint & Net |