I had no problem getting the export to Excel from XamDataGrid working. Your video and samples were perfect. But it always exports everything.
Is there any way to tell it to only export the selected records?
I did try to handle the DataPresenterExcelExporter.RecordExporting event and cancel if the record is not selected, but for some reason every record has IsSelected == false when this event is raised.
Thanks,
Mike
P.S.This is with 9.2 (WPF of course).
The record instances in the print/export grid are not the same as the record instances used by the display grid. The selection is not copied over during the print/export process. However, you can use the GetAssociatedRecord method to get the associated record from the display grid and check its state information.
Hi Michael,
The event you should use is the ExcelExporter.InitializeRecord. Then call e.Record.GetAssociatedRecord(). If this is not selected then the event args class expose various options for skiipping the record, its descendants, its siblings or to stop exporting completely.