We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

GridDataControl Drag&Drop failure?

Hi there,

I have a question about the GridDataControl binding. In the official sample, I saw the code as follows:





...
...
ShowGroupDropArea="True"
AutoPopulateRelations="False"
ShowAddNewRow="False"
ItemsSource="{StaticResource dataSource}">

In this way, it's like the binding to a class and the drag & drop works perfectly.

However, as I changed the binding from the resource to a class to directly binding to an object instance in the code behind, as follows:
ShowGroupDropArea="True"
AutoPopulateRelations="False"
ShowAddNewRow="False"
ItemsSource="{Binding myInstance}">

The drag & drop functionality disappeared. I checked the output from the debugger, and found the following error suspicious:
System.Windows.Data Error: 2 : Cannot find governing FrameworkElement or FrameworkContentElement for target element. BindingExpression:Path=Background; DataItem=null; target element is 'GeometryDrawing' (HashCode=21905215); target property is 'Brush' (type 'Brush').

I want to know that is it possible that I could bind to an instance but not a class since I want to populate data into that instance from some external methods, while at the same time have the drag & drop functionality still available.

Thank you very much.

1 Reply

JJ Jeraldes J Syncfusion Team July 28, 2010 07:37 AM UTC

Hi,

Thank you for your interest in Syncfusion products.

For your reference we have created a sample regarding the binding of the data in the griddatacontrol with the groupdrop area.

Please download the sample from the below link.

http://www.syncfusion.com/uploads/redirect.aspx?file=GCD-Binding_354d4071.zip&team=development

Let us know if you need any other details.

Regards
Jeraldes J

Loader.
Live Chat Icon For mobile
Up arrow icon