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.
You are very welcome. Glad to help out.
Thanks Rob for putting this all together, this was very helpful.
Cheers,
Anand
Hi Anand,
Sorry for the delay. You can disable the specific feature of removing columns by setting the XamDataGrid.FieldSettings.AllowHiding property to "Never".
Hey Rob thanks for all this, one last question, is it possible to disable this 'X' completely when the pivot grid is visible (and not have this remove columns feature), but still have the drag and drop work to the Column Fields. and enable it back on later, when the pivot grid is not visible.
It's possible to modify this but it is done in a pseudo-hacky way. Yes, because of the internal drag/drop stuff disabling this is going to be impossible unless you are ok with modifying the source code directly and then making your own builds. What I ended up doing was letting the XamDataGrid do it's thing and then afterwards I would override the mouse cursor with my own cursor when necessary.
I tried overriding the mouse cursor every time the mouse moved but this produced noticeable flashing as the mouse bounced between the cursor the XamDataGrid applied and the cursor that I was applying. So I opted to let the XamDataGrid keep it's cursor the majority of the time until the mouse was directly over the ColumnsFieldDropAreaControl. Once the mouse appeared over this control I switched the cursor to something else. The idea here is to let the user know that he can drop the column there. Hopefully this is acceptable for you.