Neil Hodges
Neil Hodges

Reputation: 127

Hide all RadToolTips on page upon OnItemDragStarted from RadListView

I have a number of RadToolTips within 2 RadListViews on a page.

When I drag one element from one RadListView to the other RadListView the RadToolTips keep showing up on mouse hover (as expected on hover).

How can I in JavaScript disable all the RadToolTips on the page when OnItemDragStarted client event for RadListView. Thus stopping the RadToolTips from showing up upon hover only when I'm dragging an element from one RadListView to another.

Any help would be greatly appreciated.

Upvotes: 0

Views: 621

Answers (1)

Brian Garson
Brian Garson

Reputation: 1160

If you've got a RadToolTip on your page, and a couple of list views you could try using a global js variable, and the onDrag and onDrop settings to toggle that variable. Your RadToolTip could use that variable on the beforeShow to decide if it should show a tool tip or not.. wrote up a small sample for you (not complete)

//JS
var showToolTips = true;

function dragStarted(sender,args) {
        showToolTips = false;
}
function dragFinished(sender,args){
        showToolTips = true;
}

function canShowToolTips(sender,args) 
{
        args.set_cancel(showToolTips);
}

//.NET
    <telerik:RadListView ID="radListView1" runat="server">
        <ClientSettings>
            <ClientEvents OnItemDragStarted="dragStarted" OnItemDropped="dragFinished" />
        </ClientSettings>
    </telerik:RadListView>
    <telerik:RadListView ID="radListView2" runat="server">
        <ClientSettings>
            <ClientEvents OnItemDragStarted="dragStarted" OnItemDropped="dragFinished" />
        </ClientSettings>
    </telerik:RadListView>
    <telerik:RadToolTip OnClientBeforeShow="canShowToolTips" runat="server" ID="rdToolTip1"></telerik:RadToolTip>

Upvotes: 1

Related Questions