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

Binding to AllowDragOverTab and AllowDragReorder

4 Answers 52 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Ângelo Moreira
Top achievements
Rank 1
Ângelo Moreira asked on 25 Mar 2011, 05:32 PM
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"

4 Answers, 1 is accepted

Sort by
0
Kiril Stanoev
Telerik team
answered on 30 Mar 2011, 03:54 PM
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
0
Ângelo Moreira
Top achievements
Rank 1
answered on 07 Apr 2011, 07:23 PM
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.
0
Tina Stancheva
Telerik team
answered on 13 Apr 2011, 09:06 AM
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
0
Vladislav
Telerik team
answered on 12 May 2011, 01:04 PM
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
Tags
TabControl
Asked by
Ângelo Moreira
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
Ângelo Moreira
Top achievements
Rank 1
Tina Stancheva
Telerik team
Vladislav
Telerik team
Share this question
or