Hi
I've been scouring your forums all day and have not found a suitable response to my question yet :-(
I have a custom FrameworkElementDragBehaviour class that is defined as: -
public class FrameworkElementDragBehaviour : System.Windows.Interactivity.Behavior<FrameworkElement>{...}
that handles MouseDown/MouseLeave events of the AssociatedObject.
Does the XamDataGrid have a DependencyObject to which I can bind this behaviour??? Something similar to: -
<igWpf:XamDataGrid>
<i:Interaction.Behaviors>
<behaviour:FrameworkElementDragBehaviour></behaviour:FrameworkElementDragBehaviour>
</igWpf:XamDataGrid>
But for the Selected Rows in the grid. Is this possible? I need an MVVM solution with NO code-behind.
I need to be able to drag one or more rows from the grid onto a TreeViewControl. I'm not concerned at this stage with the drop behaviour, however.
Sorry about the message formatting!!! :-)
Thanks
Mike
Hello Mike,
Thank you for your post. I have been looking into it and I can suggest you see this forum thread:
http://www.infragistics.com/community/forums/t/62066.aspx
where there is a sample showing how to drag and drop multiple Records from XamDataGrid to XamDataTree. Also I can suggest you see this article about handling events in MVVM:
http://social.technet.microsoft.com/wiki/contents/articles/18199.event-handling-in-an-mvvm-wpf-application.aspx
Please let me know if this helps you or you have further questions on this matter.
Looking forward for your reply.
Hi Stefan
Thanks for your response. I was on holiday Friday so did not get the chance to reply until now.
I've looked at that thread and unless I'm mistaken the sample still requires code-behind to handle events which is something that I have to avoid.
I've been stuck on this issue for 3 days now and would really appreciate any help. I'm a WPF newbie too (about 3 weeks experience).
I have fixed this now.
My behaviour class was hooked up to the bubbling MouseClick events rather than the tunnelling PreviewMouseClick events.
Hi Mike,
I have been working on the same application for long time. I was not able to do it with MVVM behaviour. Would you please post the sample project here. It will be a great help.
Thanks,
Basavaraj
Hello Basavaraj,
Thank you for your post.
I have been looking into your question and I created a sample application based on the scenario for you. In the sample I have created behavior that handle the PreviewMouseDown event and fire the command when mouse clicked. The command parameter of command is the event arguments from the event.
Please let me know if you need any further assistance on this matter.
Hello,
I am just checking if there is anything else I can do for you.