Click here to Skip to main content
15,072,391 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, I am quite new to C# and the .Net framework and was wondering if I can get some advise on this particular topic,

My requirement is that, I need to have an OpenFileDialog for my application, but with a slight difference in its behavior. I have files with a custom extension as *.sda, also these sda files have versions associated with them. The versions are the first 4 bytes of the files. However, without regard to the version number they all have the same extension sda.

If I filter the files with sda extension, OpenFileDialog shows all SDA files. I would like to alter its behavior where it reads the version number of the SDA files and displays only a particular versioned SDA files. Thus, it is a question of filtering files based on their content and not on their extension.

How about achieving this ? Any ideas are appreciated.
Pardon my poor English....
Posted

1 solution

I'm pretty sure that this cannot be done. The OpenFileDialogue is very set-in-its-ways when it comes to file filters.

You will have to make a custom dialogue that performs the directory file search for you. You can make it pretty basic as you won't need all the extra functionality that the OpenFileDialogue presents you with.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900