David Smith

David Smith

  • NA
  • 2k
  • 0

SaveFileDialog: Remove All Files option

Dec 28 2015 2:17 AM

I do not want to have the "All File" come up as an option in the savefiledialog box. What is the correct format below? I get an error when I remove "All Files"?

 SaveFileDialog saveFileDialog1 = new SaveFileDialog();             
saveFileDialog1.InitialDirectory = @"C:\";           
  saveFileDialog1.Title = "Save EasyTimesheet CSV";             
saveFileDialog1.DefaultExt = "csv";            
 saveFileDialog1.Filter = "CSV files (*.csv)|*.csv|All files (*.*)|*.*";             
saveFileDialog1.FilterIndex = 2;            
 saveFileDialog1.FileName = filenameFormat;

Answers (4)