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
380
DragSource and Scrolling in XamGrid
posted

Hello,

I am using the DragDropManager in the XamGrid in your newest Silverlight controls.  I have the DragSource and DropTargets working like I want with one exception.

My problem is that when I move the scroll bar in the grid, the DragStart event fires and causes the drag visual over the scroll thumb.  How can I stop this from happenning?

Also, before I added the custom drag source template (from which I populate in the DragStart event),  the drag visual was the entire XamGrid rather than just the selected rows...maybe these are related.

My code is below,

Thanks!

-Mark

    <ig:XamGrid x:Name="_endPoints"

                    ItemsSource="{Binding EndPoints}"  AutoGenerateColumns="False">
            <ig:DragDropManager.DragSource>
                <ig:DragSource IsDraggable="True" 
                               DragChannels="EndPoint"
                               DragStart="DragSource_DragStart" 
                               DragEnd="DragSource_DragEnd"  
                               Drop="DragSource_Drop">
                    <ig:DragSource.DragTemplate>
                        <DataTemplate x:Name="dragTemplate">
                            <ListBox Visibility="Visible" x:Name="dtStackPanel" ItemsSource="{Binding Path=Data}" Opacity=".5">
                                <ListBox.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal" Background="{StaticResource GreenGradientBrush}" Margin="-5">
                                            <TextBlock Width="150" FontSize="11" Style="{StaticResource NormalText}" Margin="5" Text="{Binding Name}" />
                                            <TextBlock Width="100" FontSize="11" Style="{StaticResource NormalText}" Margin="5" Text="{Binding IpAddress}"/>
                                        </StackPanel>
                                    </DataTemplate>
                                </ListBox.ItemTemplate>
                            </ListBox>
                        </DataTemplate>
                    </ig:DragSource.DragTemplate>
                </ig:DragSource>
            </ig:DragDropManager.DragSource>
            <ig:XamGrid.Columns>
                <ig:TextColumn Key="Name"/>
                <ig:TextColumn Key="Status"/>

                <ig:TextColumn Key="OperatingSystem"/>
                <ig:TextColumn Key="IpAddress"/>
          </ig:XamGrid.Columns>
</ig:XamGrid>
Parents Reply Children
No Data