Search code examples
wpffilteropenfiledialog

FileDialouge Filter type not accepting .tiproj


I am trying to filter the file type in the openfiledialouge but it is not accepting .tiproj it saying invalid file type.

 Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();

                  dlg.DefaultExt = ".tiproj";
                  dlg.Filter = "*.tiproj";

Solution

  • Below format worked for me.

     Microsoft.Win32.OpenFileDialog dlg = new Microsoft.Win32.OpenFileDialog();
     dlg.Filter = "tiproj files (*.tiproj)|*.tiproj";