Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
90
Drag & Drop from UltraGrid to ExplorerBar
posted

I'm trying to mimic outlook folders so when I click on an ultraexplorerbar item, its corresponding ultra grid updates to show everything belonging to that item.  That's all aok.

I'm also trying to drag and drop from the grid to the explorerbar, and I have a need to do different things depending on where on the ExplorerBar I drop the selected ultragrid item(s), but I can't seem to figure this out.  

i.e.  Different things will happen to the ultraGrid selections depending if they've dropped them onto an explorerbar item, explorerbar group header, or just the white space of an explorerbar group. (Actually I guess I'd do the same thing when dropping on a group header & group white space)...

Any hints would be greatly appreciated!

thx,

Brad.

  • 23930
    Verified Answer
    Offline posted

    Hi Brad,

    Thank you for posting in our forums.

    What you could do in order to see where the dragged items are dropped is to get the UIElement on which they were dropped on. You can do this by finding the point on which the item was dropped, by calling PointToClient method of the explorer and then to find the UIElement by calling the ElementFromPoint method of the UltraExplorerBarUIElement. Then depending on where the item was dropped, the UIElement is going to have different contexts. You can use the GetContext method to get them and see if it is an item or group or nothing (whitespace).

    I have attached a sample demonstrating this suggestion. The sample takes different actions depending on, if you have dropped the item on another item (moves the grid row to the datatable of this item), inside a group or on a group header (it adds a new item to the group) or on a whitespace (creates a new group).

    Please let me know if you have any additional questions.

    WG_OutlookStyle.zip