c# - Open file Dialog Filter Hides Everything WPF -


i have openfiledialog. when set filter opd show files 'x' extension hide every thing.

im new wpf. didnt put opd control (like in winform) inside wpf because couldnt find it.

openfiledialog works fine when set filter * . * show files.

i checked extension of files , correct.

also searched in problem , didnt find anything.

thanks help.

        openfiledialog opd = new openfiledialog         {             filename = "x file",             defaultext = ".x",             filter = "x files (*.x)|*.x | files (*.*)|*.*",             multiselect = true         };          bool? result = opd.showdialog();          if (result == true)         {             //...         } 

you should change filter from

"x files (*.x)|*.x | files (*.*)|*.*" 

to

"x files (*.x)|*.x|all files (*.*)|*.*" 

as stated in msdn:

do not put spaces before or after vertical bars in filter string. cause incorrect behavior in filter.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

spring cloud - How to configure SpringCloud Eureka instance to point to https on non standard port -

javascript - Bootstrap Popover: iOS Safari strange behaviour -