I want to open a save file dialog, have the user enter a filename, and if they forget the .csv extension, have it tacked on.
It would seem that the SaveFileDialog AddExtension property would work, but its doesn't. I've even set the DefaultExt property to .csv, and still nothing gets tacked on. My file gets saved just fine, but sans extension, so the user can't just double click on the file and have it open in Excel.
I have to be missing something obvious. Here's what I've got
SaveFileDialog sfd = new SaveFileDialog();
sfd.DefaultExt = "*.csv";
sfd.Filter = "Comma Separated(*.csv)|*.*";
if (sfd.ShowDialog() == DialogResult.OK)
{
// Do my file saving
}