Drag from a RadSplitContainer to Another RadSplitContainer not working

2 posts, 0 answers
  1. Matteo Gugliotta
    Matteo Gugliotta avatar
    16 posts
    Member since:
    Oct 2006

    Posted 29 Jun 2012 Link to this post

    Hi,

    i have an  user View composed by a raddocking object composed by 3 radsplicontainer.
    The first RadSplitContainer (filterSplit) contains some  object that represent predefined query contained in a RadTreeView.

    I want the user able  to drag from the tree view on left side (radTreeView ) 
    to radsplicontainer on right side, bottom, in the list box. (listBox)

    See the code below.

    <telerik:RadDocking x:Name="radDocking" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HasDocumentHost="False"
                                     telerik:StyleManager.Theme="{StaticResource AgilentTheme}" Grid.Row="0" Grid.Column="0">
                    <telerik:RadSplitContainer x:Name="filterSplit" InitialPosition="DockedLeft" Background="Transparent">
                        <telerik:RadPaneGroup>
                            <telerik:RadPane x:Name="paneFilter"  Title="Filters"  telerik:StyleManager.Theme="{StaticResource AgilentTheme}"
                                             CanUserClose="False" CanFloat="False" ContextMenuTemplate="{x:Null}"  >
                                <Grid>
                                    <Grid.RowDefinitions>
                                        <RowDefinition Height="Auto"/>
                                        <RowDefinition Height="*" />
                                    </Grid.RowDefinitions>
                                 
                                    <telerik:RadTreeView x:Name="radTreeView" Margin="5" Grid.Row="0" IsDragDropEnabled="True"
                                         Background="White" BorderThickness="1" BorderBrush="LightGray" Padding="16">
                                        <telerik:RadTreeView.ItemContainerStyle>
                                            <Style TargetType="telerik:RadTreeViewItem">
                                                <Setter Property="IsExpanded" Value="True" />
                                            </Style>
                                        </telerik:RadTreeView.ItemContainerStyle>
                                        <telerik:RadTreeView.Items>
                                            <telerik:RadTreeViewItem Header="Hardcopy Mailing"/>
                                            <telerik:RadTreeViewItem Header="Telemarketing"/>
                                            <telerik:RadTreeViewItem Header="Marketing epush"/>
                                            <telerik:RadTreeViewItem Header="Attack Day"/>
                                        </telerik:RadTreeView.Items>
                                    </telerik:RadTreeView>
                                    <telerik:RadTreeView x:Name="radFilter" Margin="5" Grid.Row="1"
                                        IsDragDropEnabled="True" Background="White" BorderThickness="1" BorderBrush="LightGray" Padding="16">
                                        <telerik:RadTreeView.ItemContainerStyle>
                                            <Style TargetType="telerik:RadTreeViewItem">
                                                <Setter Property="IsExpanded" Value="True" />
                                            </Style>
                                        </telerik:RadTreeView.ItemContainerStyle>
                                        <telerik:RadTreeView.Items>
                                            <telerik:RadTreeViewItem Header="Account">
                                                <telerik:RadTreeViewItem Header="Information"/>
                                                <telerik:RadTreeViewItem Header="Marketing Attribute"/>
                                                <telerik:RadTreeViewItem Header="Sales Rep"/>
                                            </telerik:RadTreeViewItem>
                                            <telerik:RadTreeViewItem Header="Contact">
                                                <telerik:RadTreeViewItem Header="Information"/>
                                                <telerik:RadTreeViewItem Header="Marketing Attribute"/>
                                                <telerik:RadTreeViewItem Header="Marketing Attribute"/>
                                            </telerik:RadTreeViewItem>
                                            <telerik:RadTreeViewItem Header="Lead">
                                                <telerik:RadTreeViewItem Header="With Campaign Code"/>
                                                <telerik:RadTreeViewItem Header="Without Campaign Code"/>                                           
                                            </telerik:RadTreeViewItem>
                                            <telerik:RadTreeViewItem Header="Opportunity">
                                                <telerik:RadTreeViewItem Header="With Campaign Code"/>
                                                <telerik:RadTreeViewItem Header="Without Campaign Code"/>
                                            </telerik:RadTreeViewItem>
                                        </telerik:RadTreeView.Items>
                                    </telerik:RadTreeView>
                                </Grid>
                            </telerik:RadPane>
                        </telerik:RadPaneGroup>
                    </telerik:RadSplitContainer>
                    <telerik:RadSplitContainer x:Name="gridSplit" InitialPosition="DockedTop" Background="Transparent" >
                        <telerik:RadPaneGroup >
                            <telerik:RadPane x:Name="paneGrid"  Title="Data Sets"  telerik:StyleManager.Theme="{StaticResource AgilentTheme}"
                                    CanUserClose="False" CanUserPin="False" CanFloat="False" ContextMenuTemplate="{x:Null}"
                                    DataContext="{Binding ViewPropObject, ElementName=clauses}">
     
                                <ListBox x:Name="listBox" Margin="10" >                              
                                    <ListBox.Style>
                                        <Style TargetType="ListBox">
                                            <Setter Property="telerik:RadDragAndDropManager.AllowDrop" Value="True" />
                                        </Style>
                                    </ListBox.Style>
                                    <ListBox.ItemContainerStyle>
                                        <Style TargetType="Control">
                                            <Setter Property="telerik:RadDragAndDropManager.AllowDrag" Value="True" />
                                            <Setter Property="telerik:RadDragAndDropManager.AllowDrop" Value="True" />
                                        </Style>
                                    </ListBox.ItemContainerStyle>
                                </ListBox>
                            </telerik:RadPane>
                        </telerik:RadPaneGroup>
                    </telerik:RadSplitContainer>
                    <telerik:RadSplitContainer x:Name="clausesSplit" InitialPosition="DockedBottom" Background="Transparent" >
                        <telerik:RadPaneGroup >
                            <telerik:RadPane x:Name="paneDataForm" telerik:StyleManager.Theme="{StaticResource AgilentTheme}"
                                             Title="Selected" CanUserClose="False" CanUserPin="False" CanFloat="False" ContextMenuTemplate="{x:Null}">
                                 
                            </telerik:RadPane>
                        </telerik:RadPaneGroup>
                    </telerik:RadSplitContainer>
                </telerik:RadDocking>

    When i try to drag to the second splitcontainer it appears the non allowed icon.

    Is it possible to do drag and drop between 2 different RadSplitContainer?


    Best regards
  2. Nick
    Admin
    Nick avatar
    593 posts

    Posted 03 Jul 2012 Link to this post

    Hi Matteo,

    You have set the allow drop property on the ListBox items, rather than the list box itself, is there a specific reason to do so? Note that this way you will only be able to drag to the list box only if it has at least one item in it, and you will be able to drop only on that item, not the list box. 

    Could you try setting the allow drop property to true on the List box itself?  

    Greetings,
    Nik
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
Back to Top