Note that there are some explanatory texts on larger screens.

plurals
  1. PODragging a Rectangle which is inside a Grid
    text
    copied!<p>I managed to sort my "draggable inside grid" issue, however I found another issue.</p> <p>When I start dragging the Rectangle, it dissapears and reappears on mouseup.</p> <p>My code:</p> <pre><code>public Page() { InitializeComponent(); dragGrid.AddHandler(RadDragAndDropManager.DragQueryEvent, new EventHandler&lt;DragDropQueryEventArgs&gt;(OnDragQuery)); dragGrid.AddHandler(RadDragAndDropManager.DropQueryEvent, new EventHandler&lt;DragDropQueryEventArgs&gt;(OnDropQuery)); dragGrid.AddHandler(RadDragAndDropManager.DropInfoEvent, new EventHandler&lt;DragDropEventArgs&gt;(OnDropInfo)); dragGrid.AddHandler(RadDragAndDropManager.DragInfoEvent, new EventHandler&lt;DragDropEventArgs&gt;(OnDragInfo)); Loaded += new RoutedEventHandler(Page_Loaded); } void Page_Loaded(object sender, RoutedEventArgs e) { //Initialise the draggable elements RadDragAndDropManager.SetAllowDrag(onePX, true); RadDragAndDropManager.SetAllowDrag(twoPX, true); RadDragAndDropManager.SetAllowDrag(fourPX, true); } private void OnDragQuery(object sender, DragDropQueryEventArgs e) { if (e.Options.Status == DragStatus.DragQuery) { e.QueryResult = true; //The DragAndDropmanager will detach the element and drag it around the screen. var source = e.Options.Source as Rectangle; source.Visibility = Visibility.Collapsed; e.Options.Payload = source; e.Handled = true; } if (e.Options.Status == DragStatus.DropSourceQuery) { e.QueryResult = true; } } private void OnDropQuery(object sender, DragDropQueryEventArgs e) { if (e.Options.Status == DragStatus.DropDestinationQuery) { e.QueryResult = true; } } private void OnDragInfo(object sender, DragDropEventArgs e) { if (e.Options.Status == DragStatus.DragCancel) { e.Options.Source.Visibility = Visibility.Visible; } } private void OnDropInfo(object sender, DragDropEventArgs e) { if (e.Options.Status == DragStatus.DropComplete) { Grid.SetColumn(e.Options.Source, Grid.GetColumn(e.Options.Destination)); Grid.SetRow(e.Options.Source, Grid.GetRow(e.Options.Destination)); e.Options.Source.Visibility = Visibility.Visible; e.Handled = true; } } </code></pre> <p>XAML:</p> <pre><code>&lt;UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:dragDrop="clr-namespace:Telerik.Windows.Controls.DragDrop;assembly=Telerik.Windows.Controls" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="TestBench.Page" MinHeight="500" MinWidth="300"&gt; &lt;Grid x:Name="LayoutRoot" Background="White"&gt; &lt;Grid x:Name="dragGrid" Margin="0,0,0,58" ShowGridLines="False"&gt; &lt;Grid.RowDefinitions&gt; &lt;RowDefinition Height="32" /&gt; &lt;RowDefinition Height="32" /&gt; &lt;RowDefinition Height="32" /&gt; &lt;RowDefinition Height="32" /&gt; &lt;RowDefinition Height="32" /&gt; &lt;RowDefinition Height="32" /&gt; &lt;RowDefinition Height="32" /&gt; &lt;RowDefinition Height="32" /&gt; &lt;RowDefinition Height="32" /&gt; &lt;RowDefinition Height="32" /&gt; &lt;RowDefinition Height="32" /&gt; &lt;RowDefinition Height="32" /&gt; &lt;RowDefinition Height="32" /&gt; &lt;RowDefinition Height="32" /&gt; &lt;/Grid.RowDefinitions&gt; &lt;Grid.ColumnDefinitions&gt; &lt;ColumnDefinition Width="32" /&gt; &lt;ColumnDefinition Width="32" /&gt; &lt;ColumnDefinition Width="32" /&gt; &lt;ColumnDefinition Width="32" /&gt; &lt;ColumnDefinition Width="32" /&gt; &lt;ColumnDefinition Width="32" /&gt; &lt;ColumnDefinition Width="32" /&gt; &lt;ColumnDefinition Width="32" /&gt; &lt;ColumnDefinition Width="32" /&gt; &lt;ColumnDefinition Width="32" /&gt; &lt;ColumnDefinition Width="32" /&gt; &lt;ColumnDefinition Width="32" /&gt; &lt;ColumnDefinition Width="32" /&gt; &lt;/Grid.ColumnDefinitions&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="0" Grid.Row="0" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="1" Grid.Row="0" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="2" Grid.Row="0" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="3" Grid.Row="0" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="4" Grid.Row="0" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="5" Grid.Row="0" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="6" Grid.Row="0" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="7" Grid.Row="0" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="8" Grid.Row="0" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="9" Grid.Row="0" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="10" Grid.Row="0" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="11" Grid.Row="0" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="12" Grid.Row="0" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="0" Grid.Row="1" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="1" Grid.Row="1" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="2" Grid.Row="1" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="3" Grid.Row="1" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="4" Grid.Row="1" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="5" Grid.Row="1" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="6" Grid.Row="1" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="7" Grid.Row="1" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="8" Grid.Row="1" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="9" Grid.Row="1" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="10" Grid.Row="1" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="11" Grid.Row="1" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="12" Grid.Row="1" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="0" Grid.Row="2" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="1" Grid.Row="2" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="2" Grid.Row="2" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="3" Grid.Row="2" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="4" Grid.Row="2" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="5" Grid.Row="2" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="6" Grid.Row="2" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="7" Grid.Row="2" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="8" Grid.Row="2" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="9" Grid.Row="2" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="10" Grid.Row="2" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="11" Grid.Row="2" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="12" Grid.Row="2" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="0" Grid.Row="3" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="1" Grid.Row="3" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="2" Grid.Row="3" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="3" Grid.Row="3" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="4" Grid.Row="3" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="5" Grid.Row="3" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="6" Grid.Row="3" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="7" Grid.Row="3" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="8" Grid.Row="3" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="9" Grid.Row="3" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="10" Grid.Row="3" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="11" Grid.Row="3" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="12" Grid.Row="3" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="0" Grid.Row="4" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="1" Grid.Row="4" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="2" Grid.Row="4" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="3" Grid.Row="4" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="4" Grid.Row="4" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="5" Grid.Row="4" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="6" Grid.Row="4" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="7" Grid.Row="4" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="8" Grid.Row="4" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="9" Grid.Row="4" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="10" Grid.Row="4" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="11" Grid.Row="4" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="12" Grid.Row="4" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="0" Grid.Row="5" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="1" Grid.Row="5" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="2" Grid.Row="5" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="3" Grid.Row="5" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="4" Grid.Row="5" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="5" Grid.Row="5" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="6" Grid.Row="5" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="7" Grid.Row="5" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="8" Grid.Row="5" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="9" Grid.Row="5" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="10" Grid.Row="5" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="11" Grid.Row="5" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="12" Grid.Row="5" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="0" Grid.Row="6" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="1" Grid.Row="6" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="2" Grid.Row="6" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="3" Grid.Row="6" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="4" Grid.Row="6" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="5" Grid.Row="6" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="6" Grid.Row="6" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="7" Grid.Row="6" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="8" Grid.Row="6" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="9" Grid.Row="6" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="10" Grid.Row="6" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="11" Grid.Row="6" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="12" Grid.Row="6" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="0" Grid.Row="7" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="1" Grid.Row="7" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="2" Grid.Row="7" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="3" Grid.Row="7" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="4" Grid.Row="7" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="5" Grid.Row="7" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="6" Grid.Row="7" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="7" Grid.Row="7" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="8" Grid.Row="7" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="9" Grid.Row="7" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="10" Grid.Row="7" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="11" Grid.Row="7" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="12" Grid.Row="7" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="0" Grid.Row="8" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="1" Grid.Row="8" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="2" Grid.Row="8" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="3" Grid.Row="8" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="4" Grid.Row="8" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="5" Grid.Row="8" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="6" Grid.Row="8" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="7" Grid.Row="8" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="8" Grid.Row="8" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="9" Grid.Row="8" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="10" Grid.Row="8" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="11" Grid.Row="8" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="12" Grid.Row="8" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="0" Grid.Row="9" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="1" Grid.Row="9" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="2" Grid.Row="9" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="3" Grid.Row="9" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="4" Grid.Row="9" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="5" Grid.Row="9" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="6" Grid.Row="9" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="7" Grid.Row="9" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="8" Grid.Row="9" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="9" Grid.Row="9" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="10" Grid.Row="9" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="11" Grid.Row="9" /&gt; &lt;Rectangle dragDrop:RadDragAndDropManager.AllowDrop="True" Fill="LightBlue" Grid.Column="12" Grid.Row="9" /&gt; &lt;Rectangle Width="32" Height="32" Fill="Black" x:Name="onePX" Grid.Column="0" Grid.Row="0" /&gt; &lt;Rectangle Width="32" Height="64" Fill="Black" x:Name="twoPX" Grid.Column="0" Grid.Row="2" Grid.RowSpan="2" /&gt; &lt;Rectangle Width="64" Height="64" Fill="Black" x:Name="fourPX" Grid.Column="0" Grid.Row="5" Grid.ColumnSpan="2" Grid.RowSpan="2" /&gt; &lt;TextBlock x:Name="textOutput" HorizontalAlignment="Left" Margin="8,8,0,8" Grid.Row="10" Grid.RowSpan="2" TextWrapping="Wrap" Text="TextBlock" d:LayoutOverrides="Height" Grid.ColumnSpan="6" Width="184"/&gt; &lt;/Grid&gt; &lt;/Grid&gt; &lt;/UserControl&gt; </code></pre> <p>Now, I <strong>know</strong> that my code is detaching the Rectangle from the Grid (which is why it's dissapearing), any idea how I can stop this (or an elegant work around would be nice) ^_^</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload