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

Identify elements in a canvas

2 Answers 61 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
xola139
Top achievements
Rank 1
xola139 asked on 12 Feb 2010, 08:00 PM
I'm using dragandrop with multiple elements that pull a ListBoxItem a canvas and I wonder if there is a way of identifying the elements I have in the canvas, I understand that the location coordinates I can do with e . Options.CurrentDragPoint.X.ToString () ,but I can not identify each one of these with a name or identifier

Help me please

2 Answers, 1 is accepted

Sort by
0
Accepted
Kiril Stanoev
Telerik team
answered on 15 Feb 2010, 01:13 PM
Hello Xola,

I am not sure that I fully understand what your concern is. When you add the item in the Canvas, you can set the item's Name property and then, if you want to retrieve it, you can use the Canvas' FindName method.

TextBlock textBlock = new TextBlock() { Text = "Unmodified" };
textBlock.Name = "textBlock1";
canvas1.Children.Add(textBlock);
TextBlock retrievedTextBlock = canvas1.FindName("textBlock1") as TextBlock;
retrievedTextBlock.Text = "Modified";

If this does not answer your question, could you please elaborate a little bit more on what are you trying to achieve and what the actual proble with RadDragAndDropManager is. I'd be glad to further assist you.

Sincerely yours,
Kiril Stanoev
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
xola139
Top achievements
Rank 1
answered on 18 Feb 2010, 05:15 PM
Admin excellent thank you very much for your attention, just what I needed, this also helps me, and also found an example in the forum which helped me know the location of my items from the canvas
Tags
DragAndDrop
Asked by
xola139
Top achievements
Rank 1
Answers by
Kiril Stanoev
Telerik team
xola139
Top achievements
Rank 1
Share this question
or