user966379
user966379

Reputation: 2993

How can move an object from one cell to other cell in c#

<grid>
    <Image Name="i1" Source="king.jpg" Grid.row ="4" Grid.Column="1" 
        PreviewMouseLeftButtonDown="im_PreviewMouseLeftButtonDown" ></Image>
</grid>

I know when image is clicked, im_PreviewMouseLeftButtonDown function is invoked. Now I want to keep this image in other cell(lets in row 2, col 4). Please if anyone can help to write this function im_PreviewMouseLeftButtonDown.

Upvotes: 0

Views: 164

Answers (1)

Henk Holterman
Henk Holterman

Reputation: 273711

Grid.SetRow(i1, 2);
Grid.SetColumn(i1, 4);

Upvotes: 1

Related Questions