cue.DragTooltipContent =
" " + ((GroupUnitItem)currentDropItem).Name;
so that it shows the required name in the Drop After and Drop Before, however the tooltip above it continues to show me the type of my item, instead of the name. Where do I set this?
Thanks,
Sameeksha
5 Answers, 1 is accepted
Please check the OnDropInfo method of the RowReorderBehavior.cs in our online demo.
There the DragTooltipContent is set to the currentDropItem variable which is initialized in the OnGridViewRowDropQuery event. This is the place you are looking for.
Kind regards,
Veselin Vasilev
the Telerik team
Hello Veselin,
Thanks for your reply.
That is actually the method where I had modified my code. My OnDropInfo function looks like this:
// Set a suitable text:
GridViewRow row = this.AssociatedObject.ItemContainerGenerator.ContainerFromItem(this.currentDropItem) as GridViewRow;
DropPosition fff = this.GetDropPositionFromPoint(e.Options.CurrentDragPoint, row);
cue.DragActionContent =
String.Format("Drop {0}", Enum.GetName(typeof(DropPosition), fff));
if (currentDropItem is Group)
{
cue.DragTooltipContent =
" " + ((Group)currentDropItem).Name;
}
else if (currentDropItem is GroupUnitItem)
{
cue.DragTooltipContent =
" " + ((GroupUnitItem)currentDropItem).Name;
}
What this achieves is that the Drop After and Drop Before get populated with the name of my drop item, however there is another tooltip that denotes the current item (Customer: ABCD), and this is set to the type of my item, rather than the name, so I get the following tooltips:
1. For current item: Microsoft.adcenter.GroupUnitItem
2. For drag: Drop After: Editorial
I need a way to fix the first tooltip to say the name of the item as the second one does.
Thanks,
Sameeksha
You can put a breakpoint in that method and check what is the value of the
((Group)currentDropItem).Name
It should give you a direction what is going on.
Ideally, you will prepare a sample project and send it to us in a support ticket.
Best wishes,
Veselin Vasilev
the Telerik team
The name of my ((Group)currentDropItem).Name is coming out to be Phase 1, Phase 2 etc.
And it is set correctly in the Drop After, Before.
Please check out the screenshot attached.
Where it says Microsoft.adCenter.Orchestration.WebUI.Service.GroupUnitItem, I want it to say Phase 1, Phase 1 being the name property of that type of item.
Do let me know if there is a way I could modify that one.
Thanks for your time
Sameeksha
I have prepared sample application that customize the drag cue. Please, have a look at the attachment and let me know if this works for you.
Best wishes,
Tsvyatko
the Telerik team