2

I want my open and save dialogs to display XML files. I have this definition:

// The save dialog
dlg := TSaveDialog.Create(nil);
dlg.Options := [ofOverwritePrompt];
dlg.Title := 'Seleccione la ubicación del archivo';
dlg.Filter := 'Xml | *.xml | Todo | *.*';
dlg.DefaultExt := 'xml';
dlg.Execute();
// The open dialog
dlg := TOpenDialog.Create(self);
dlg.Title := 'Seleccione la ubicación del archivo';
dlg.Filter := 'Xml | *.xml | Todo | *.*';
dlg.DefaultExt := 'xml';
dlg.Execute();

But it doesn't show XML files. To show any XML files in a path, I need to choose the "Todo" (*.*) filter. Why doesn't it show files when the XML filter is selected?

Rob Kennedy
  • 161,384
  • 21
  • 275
  • 467
ramiromd
  • 2,019
  • 8
  • 33
  • 62

1 Answers1

7

Remove the spaces around the extension. The dialog is trying to filter "*.xml " files, but there's none. Refer to the documentation for examples.

Sertac Akyuz
  • 54,131
  • 4
  • 102
  • 169