How can I restrict the list of drive letters displayed by the WPF SaveFileDialog?
+2
A:
IMHO Since it is just a wrapper over the old FileDialog common control, I'd be surprised if you could do this. I could be wrong...
I'd begin by questioning why you need to restrict some drives (Windows- Group policies and other security mechanisms should take care of user rights) If you really need this.. I'd go for
- Override the FileOk event, check the drive in the selected path and cancel the event if the path is not permissible. Also notify the user explaining the reason for denial
- If that's not good for UX reasons, you could tinker around with registry and/or group policy keys to hide the drive. Googling should give you some pointers.. but I'd not do this myself. Not recommended.
Gishu
2008-11-05 06:48:06