Hi,
I have a small application that allow user to drag and drop between each TextBlock. If a text is dragged to another TextBlock, the drag source will remove its content. It works fine until I want to drag to an empty TextBlock (which had something inside before but got dragged out). The cursor turned to cross and it did not allow to drop there anymore. Would you please let me know if there is any special setting to make it happen? I already placed DragSource and DropTarget within the TextBlock, DragChannels and DropChannels were the same.
Thanks in advance.
Hello Hieu,
Thank you for your post.
I am very glad that my support was helpful for you. If you require any further assistance on the matter, please do not hesitate to ask.
Thank you very much for your time Zhivko. Your latest sample helped me solve the problem. I really appreciate your time and effort for this issue even though it does not relate to Infragistics Drag and Drop Framework. Great job!
I have been investigating further your issue. It seems that it is caused by default width of the TextBlock. When drag text from one DropableTextBlock to other and set the first one to empty string, the width of TextBlock is resized to zero, so you cannot drag in it anymore. You can set the MinWidth property of TextBlock in your UserControl to be able to drag text to the TextBlock anytime. I modified the last sample application to show you how you can implement the functionality that you are looking for.
Please let me know if you need any further assistance eon the matter.
Hi Zhivko,
Thank you for the new sample. Please allow me to clarify a little bit about my scenario: My screen has at least 16 TextBlock and a ListBox. Their content will be draggable back and forth. DropableTextBlock was created because I don't want to add DropTarget and DragSource to each and every TextBlock.
To answer your questions:
- Yes, I want to drag text from one DropableTextBlock and move to another one.
- Yes, the text should transfer back and forth.
In your modified sample, I can see that you added DragSource and DropTarget to every DropableTextBlock. This is something I am trying to avoid. Is it possible to just add DragSource and DropTarget inside UserControl only and handle everything from there? This might save some time and the code will be easily maintained.
Thanks.
Hello Tangailam,
Thank you for your reply.
I have been looking into in and the modified sample application that you have provided. I am not completely sure that I understand correctly what you try to achieve.
Would you please provide me with more details about it?
If I understand your requirement correctly you want to use Drag and Drop functionality for each custom DropableTextBlock. Do you want to be able to handle the text from one DropableTextBlock and move it to other DropableTextBlock? Should the text from first DropableTextBlock to be visible in the second one and to be able to drag the text to first one again? If is it you can adding DropTarget object and DragSource object to your DropableTextBlock instead of TextBlock in UserControl.
I modified the sample application to show you how you can implement this. Please let me know if I missing something from your scenario.
Please let me know if you need any further assistance on the matter.