简体   繁体   中英

How can rename Node of Tree view control on double click in asp.net c#?

我需要在asp.net c#中双击节点时重命名树视图控件的节点。由于在asp.net树视图控件中没有双击事件,因此请任何人可以为我提供一些有关如何可以创建自定义双击事件,以及如何重命名树视图节点。

You can use single click event to catch double click: just compare last click time with current time and if difference is less then double click period - it is definitely double click event. Something like:

DateTime LastClickTime = DateTime.MinValue;

void on_click()
{
    if (DateTime.Now - LastClickTime < TimeSpan.FromMilliseconds(100))
        on_double_click();

    LastClickTime = DateTime.Now;     
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM