You will need to define this event by yourself - override the DropDownList:
public class myDropDownList : DropDownList, IPostBackEventHandler
{
public event EventHandler DblClick;
private const string _DOUBLE_CLICK = "dbl";
protected virtual void OnDblClick(EventArgs e)
{
if (DblClick!= null)
{
DblClick(this, e);
}
}
protected override void OnInit(EventArgs e)
{
if (this.Page != null)
{
this.Page.RegisterRequiresControlState(this);
}
base.OnInit(e);
}
protected void Page_PreRender(object sender, EventArgs e)
{
string script = this.Page.GetPostBackEventReference(this, _DOUBLE_CLICK);
this.Attributes.Add("ondblclick", script);
}
void IPostBackEventHandler.RaisePostBackEvent(string eventArgument)
{
if (eventArgument == _DOUBLE_CLICK)
{
this.OnDblClick(EventArgs.Empty);
}
}
}
Please note that I do not have 1.1 handy - and the code above I compiled
from a similar control in 2.0 - so there might be some syntax errors - I just
wanted to get you an idea of how this could be accomplished.
"Lit" wrote:
Jeff,
I don't see a double click on a listbox. I been looking for this. I need
that functionality or possibly a Ctrl-Click
hope someone will give us an answer.
Lit
"Jeff User" <je*****@hotmail.comwrote in message
news:ec********************************@4ax.com...
Hi
Using .NET 1.1, C#, web app
I (actually our client) would like to be able to double click a
selection in a listbox and have it postback to server . There I would
want to access the item that was double clicked.
Any idea how to go about this?
Thanks
Jeff