This is a migrated thread and some comments may be shown as answers.

Binding in drag-drop

5 Answers 80 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Sameeksha
Top achievements
Rank 1
Sameeksha asked on 02 Sep 2010, 02:07 AM
This is probably a trivial question, but where do I set the binding for the tooltip in the drag-drop cue in the reorder for grid rows? In the example mentioned for re-order of grid rows, there is a Customer : CustomerName template that appears in the Drop After and Drop Before., and also on top. I modified the ReorderBehavior file to

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

Sort by
0
Veselin Vasilev
Telerik team
answered on 03 Sep 2010, 04:44 PM
Hi Sameeksha,

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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Sameeksha
Top achievements
Rank 1
answered on 08 Sep 2010, 08:07 PM

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

 

0
Veselin Vasilev
Telerik team
answered on 09 Sep 2010, 09:01 AM
Hi 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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Sameeksha
Top achievements
Rank 1
answered on 10 Sep 2010, 12:06 AM
Thanks again Veselin.
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
0
Tsvyatko
Telerik team
answered on 10 Sep 2010, 01:40 PM
Hello 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
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
DragAndDrop
Asked by
Sameeksha
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
Sameeksha
Top achievements
Rank 1
Tsvyatko
Telerik team
Share this question
or