Binding to AllowDragOverTab and AllowDragReorder

5 posts, 0 answers
  1. Ângelo Moreira
    Ângelo Moreira avatar
    11 posts
    Member since:
    Jan 2010

    Posted 25 Mar 2011 Link to this post

    Hi,
    I am trying to bind to "AllowDragOverTab" and "AllowDragReorder" properties (in XAML) of RadTabcontrol, without success. They are both dependancy properties. Is this an identified issue ?

    Thank you,
    "AM"
  2. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1511 posts

    Posted 30 Mar 2011 Link to this post

    Hello Ângelo,

    Currently there is an issue when toggling both AllowDragOverTab/AllowDragReorder values. I've logged this issue in our PITS under the name "TabControl: AllowDragOverTab and AllowDragReorder cannot be changed dynamically". We will try to fix this issue for our upcoming Service Pack release which is scheduled for the middle of April.
    One possible workaround is to to iterate through all tab items and set AllowDrop and AllowDrag:

    foreach (var item in tabControl1.Items)
    {
        RadTabItem tabItem = item as RadTabItem;
        if (tabItem != null)
        {
            RadDragAndDropManager.SetAllowDrop(tabItem, true);
            RadDragAndDropManager.SetAllowDrag(tabItem, true);
        }
    }

    Let me know how this works.  Also I've also updated your Telerik points accordingly.

    All the best,
    Kiril Stanoev
    the Telerik team
  3. DevCraft banner
  4. Ângelo Moreira
    Ângelo Moreira avatar
    11 posts
    Member since:
    Jan 2010

    Posted 07 Apr 2011 Link to this post

    Thank you.
    I'm afraid tabControl1.Items gives me the objects binded to the ItemsSource, rather than the dataTemplate (RadTabItem) that I need to allow drop.

    How can I achieve this?

    Thank you.
  5. Tina Stancheva
    Admin
    Tina Stancheva avatar
    3298 posts

    Posted 13 Apr 2011 Link to this post

    Hi Ângelo Moreira,

    You can use the RadTabControl.ItemContainerGenerator to access the RadTabItem container of a business item:
    foreach (var item in myTabControl.Items)
    {
        RadTabItem tabItem = myTabControl.ItemContainerGenerator.ContainerFromItem(item) as RadTabItem;
        if (tabItem != null)
        {
            RadDragAndDropManager.SetAllowDrop(tabItem, true);
            RadDragAndDropManager.SetAllowDrag(tabItem, true);
        }
    }

    However, in order to use the ContainerFromItem() method you need to make sure that the ItemContainerGenerator.Status is ContainersGenerated. Otherwise if the generator isn't started, that means that no RadTabItem containers are created to host the data items yet and you won't be able to apply the drag/drop logic.

    Kind regards,
    Tina Stancheva
    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. Vladislav
    Admin
    Vladislav avatar
    275 posts

    Posted 12 May 2011 Link to this post

    Hi Ângelo Moreira,

    We want to inform you, that this issue is already fixed.
    You can check it in our next internal build. It should be released in the beginning of the next week.
    Any feedback/comments on the subject (once the internal build is available) are highly appreciated.


    Best wishes,
    Vladislav
    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