DoubleClick Event on ListBox

K

kgray

I have created a user control that has a list box webcontrol.
Unfortunately, The listbox control does not have the doubleclick event
in it, and for the life of me, I can not seem to create one. Does
anyone have any tips on how to do this? The user control is this list
box, that is populated when the user control is loaded into my web page.
 
R

recoil

the <select control supports a client-side javascript event called
ondblclick

so you could simply create a dummy control such as a hidden button
and then using
String APostBackReferenceforsomecontrolorevent =
GetPostBackClientEvent(btnOnListBoxDblClick, "");

myListBox.Attributes.Add("ondblclick",
APostBackReferenceforsomecontrolorevent);

There are other ways of handling this and depending upon your situation
you may wish to customize it but this is a very basic example that
hopefully will get youstarted.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top