Is it possible you guys can post some sample code, that shows drag and drop from XamDataGrid's Field Chooser to the ColumnsFieldDropAreaControl. We have a XamDataGrid and XamPivotGrid in the same screen, and I want to be able to drag columns from XamDataGrid's field chooser to the ColumnsFieldDropAreaControl/RowFieldsDropAreaControl.
Hi Anand,
This might be tricky since the field chooser on the XamDataGrid and the ColumnsFieldDropAreaControl in the pivot grid have their own drag drop handling. I'm putting together a sample to see what can be done. I will get back to you after the investigation.
This was a bit simpler than I initially thought. As I said previously, the XamDataGrid implements it's own version of drag/drop and currently it is not possible to hook into this. So to make this work I handled the PreviewMouseLeftButtonDown event on the LabelPresenter inside the FieldChooser and the PreviewMouseLeftButtonUp event on the ToolWindow that contains the FieldChooser. When the button down event fires, I grab the Field and store it. In the button up event, as long as there's a valid Field I check to see if the mouse was released above the ColumnsFieldDropAreaControl. If it was released above this, it adds the appropriate dimension to the XamPivotGrid.DataSource.Columns collection.
I have attached my sample for your consideration. Let me know if you have any questions on this.