troubleshooting Question

Listbox with doubleclick event (one-click event fires BEFORE double-click event, messing it up)

Avatar of Nygter
Nygter asked on
C#
3 Comments1 Solution732 ViewsLast Modified:
Greetings..

I've successfully made a doubleclick event on a listbox, but with one annoying issue i cannot bare with:

The "single-click" event fires first (when i select an listitem) so that the double-click event doesn't work until the second time i double-click the listitem. See code below.
/// CODE I PAGE LOAD.
 
lbAllTemplateTasks.Attributes.Add("ondblclick", ClientScript.GetPostBackEventReference(lbAllTemplateTasks, "addthis"));
 
if (Request["__EVENTARGUMENT"] != null && Request["__EVENTARGUMENT"] == "addthis")
        {
            if (lbAllTemplateTasks.SelectedIndex > -1)
            {
                TemplateTask tt = TemplateTask.TryFind(Convert.ToInt32(lbAllTemplateTasks.SelectedValue));
                Stage stage = Stage.Find(Convert.ToInt32(ddlSelectStage.SelectedValue));
 
                stage.TemplateTaskList.Add(tt);
                stage.SaveAndFlush();
            }
 
            lbAllTemplateTasks.DataBind();
            lbThisTemplateTasks.DataBind();
            upnlAllTemplateTasks.Update();
            upnlThisTemplateTasks.Update();
        }
ASKER CERTIFIED SOLUTION
apresto

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros