I've added that code into the code behind file of a ASP webpage i'm build and I'm still unable to get a double click event. Am I doing this right? Also, I'm running .NET 3.5
Thanks. Jim
SergeyPoberezovski wrote:
You will need to define this event by yourself - override the
23-Aug-07
You will need to define this event by yourself - override the DropDownList
public class myDropDownList : DropDownList, IPostBackEventHandle
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
:
Previous Posts In This Thread:
double click event on listbox
H
Using .NET 1.1, C#, web ap
I (actually our client) would like to be able to double click
selection in a listbox and have it postback to server . There I woul
want to access the item that was double clicked
Any idea how to go about this
Thank
Jeff
Jeff,I don't see a double click on a listbox. I been looking for this.
Jeff
I do not see a double click on a listbox. I been looking for this. I nee
that functionality or possibly a Ctrl-Clic
hope someone will give us an answer
Lit
You will need to define this event by yourself - override the
You will need to define this event by yourself - override the DropDownList
public class myDropDownList : DropDownList, IPostBackEventHandle
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
:
I want to do this with a listbox, not a dropdownlist.Is the procedure the same?
I want to do this with a listbox, not a dropdownlist
Is the procedure the same
Thank
jeff
Jeff,The code that refers to handling double click event is not control
Jeff
The code that refers to handling double click event is not control specifi
- you should be able to use it in ListBox
:
Submitted via EggHeadCafe - Software Developer Portal of Choice
Get Silverlight 4 Installed: Tips and Tricks
http://www.eggheadcafe.com/tutorial...b-f54c56a64ed9/get-silverlight-4-install.aspx