Binding in drag-drop

6 posts, 0 answers
  1. Sameeksha
    Sameeksha avatar
    4 posts
    Member since:
    Sep 2010

    Posted 01 Sep 2010 Link to this post

    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
  2. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 03 Sep 2010 Link to this post

    Hi Sameeksha,

    Please check the Snippet OnDropInfo method of the RowReorderBehavior.cs in our online demo.
    There the DragTooltipContent is set to the Snippet currentDropItem variable which is initialized in the Snippet 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
  3. DevCraft banner
  4. Sameeksha
    Sameeksha avatar
    4 posts
    Member since:
    Sep 2010

    Posted 08 Sep 2010 Link to this post

    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

     

  5. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 09 Sep 2010 Link to this post

    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
  6. Sameeksha
    Sameeksha avatar
    4 posts
    Member since:
    Sep 2010

    Posted 09 Sep 2010 Link to this post

    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
  7. Tsvyatko
    Admin
    Tsvyatko avatar
    832 posts

    Posted 10 Sep 2010 Link to this post

    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
Back to Top
DevCraft banner